Attempted to access TPvhs.data(3); index out of bounds because numel(TPvhs.data)=1.
Show older comments
Hi, I've discovered that this is a common error. I have created a variable that is 1x1 but I'm trying to acces with a different size. I've traied to fix it...but I failed!
Can someone help me?
Thanks!
R='CarbonDioxide';
T=300;
P=100;
%open the input file for writing
fid=fopen('C:\users\alessandro\desktop\input.dat','w');
%write the inputs to the file
fprintf(fid,'''%s'' %f %f',R,T,P);
%close the file
fclose(fid);
%run the macro file
system('C:\EES32\EES.exe C:\users\alessandro\desktop\Macro.emf');
%import results from the file
TPvhs=importdata('C:\users\alessandro\desktop\output.dat');
%assign the results to outputs
v=TPvhs.data(3);
h=TPvhs.data(4);
s=TPvhs.data(5);
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!