How to replace values in a table with the outputs of another code?
Show older comments
I am attempting to create a table that will display the results gotten from running through another MATLAB code however I just cannot seem to replace the values in the table with the new values.
I have the Table labeled so that I can output it but I don't understand why I can't replace the Table values (that I have currently stored as 0's) with the outputs. I got and error originally saying that the right hand side needed to be a table or an array (Originally i just had the "minPModel" and such but since replaced them with the new table "MinMaxTab" and it still won't accept it). I don't understand how to get it to work.
Attached is the MinMax file
Table1 = table([0.50; 0.75; 1; 1.25; 1.5; 1.75; 2],...
[0; 0; 0; 0; 0; 0; 0],...
[0; 0; 0; 0; 0; 0; 0],...
[0; 0; 0; 0; 0; 0; 0],...
[0; 0; 0; 0; 0; 0; 0],...
'VariableNames',{'R (mmHg*s/ml)' 'Pressure Maximum (mmHg)' 'Pressure Minimum (mmHg)' 'Presure Mean (mmHg)' 'Pulse Pressure (max-min) (mmHg)'});
for R = 0.5:.25:2
k = 2;
fprintf("R = %d", R);
run MinMax.m;
MinMaxTab = [minPModel; maxPModel; meanPModel];
Table1(2,k) = MinMaxTab(1,1);
Table1(3,k) = MinMaxTab(1,2);
Table1(4,k) = MinMaxTab(1,3);
Table1(5,k) = Table1(3,k)-Table1(2,k);
k=k+1;
end
Table1
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!