I have been faced with the 'Index exceeds array bounds' while graphing.
Show older comments
Hey, I am trying to use the for code to plot a graph and it keeps saying that my index exceeds the array bounds. Not sure what to do to correct the loop. Thank you in advance.
Tr=0.85:0.05:1;
MV= 0.15:0.02:1.75
Pr=zeros(length(Tr),81);
Tr=0.85:0.05:1;
for i= 1:length(Tr)
i
MV= 0.15:0.02:1.75;
[Pr(i,:)] = Isotherm(Tr(i));
hplot=semilogy(MV,Pr(i,:),'-')
hold on
set(hplot(i),'color', 'red', 'Marker','o')
set(hplot(i),'color', 'cyan')
set(hplot(i),'color', 'magenta')
set(hplot(i),'color', 'blue')
set(hplot,'linewidth', 1)
end
6 Comments
madhan ravi
on 4 Nov 2018
Isotherm?
Tamunopiriye Whyte
on 4 Nov 2018
Tamunopiriye Whyte
on 4 Nov 2018
madhan ravi
on 4 Nov 2018
You can’t index a floating number to a variable
Tamunopiriye Whyte
on 4 Nov 2018
Tamunopiriye Whyte
on 4 Nov 2018
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!