1
votes

Warning: Direct access of structure fields returned by a function call (e.g., call to INPU) is not allowed. See MATLAB 7.10 Release Notes, "Subscripting Into Function Return Values" for details.

In Main at 3 ??? Attempt to reference field of non-structure array.

Error in ==> Main at 3 INPU.m;

getting this error...how to call this inpu.m file.

my input file is below. it reads data from dat file. %---INPU.m---- %This file reads the input data from the file ‘‘'ex.dat'" and saves them in vector form

n=csvread('ex.dat',1,0,[1,0,1,0]);

constr=csvread('ex.dat',4,0,[4,0,4,(3*n-1)]);

q=csvread('ex.dat',7,0,[7,0,7,(3*(n+1)-1)]);

r=csvread('ex.dat',10,0,[10,0,10,(3*n-1)]);

x=csvread('ex.dat',13,0,[13,0,13,(3*n-1)]);

dx=csvread('ex.dat',16,0,[16,0,16,(3*n-1)]);
1

1 Answers

0
votes

To call a function, you use it's name, not the filename (which has a .m file extension). The function name is the portion of the filename without the .m. In your case, since your function is saved in the file INPU.m, you just invoke it with INPU.