How to take values from a workspace, multiply them by a variable and plot the result?
Mostra commenti meno recenti
Hi,
I have two workspace arrays that are 51x1. One is for DeoxyHemoglobin and the other is for OxyHemoglobin. I need to plot them against eachother when there is 90% of Oxy to 10% Deoxy and go from 90-10 and 10-90, respectively. If this was not clear, an example would be, take the value from the Oxy_Hb_450_700 at 1x1 and multiply it by 10 and then the value from Doxy_Hb_450_700 at 1x1 and multiply it by 90, add them together and plot that against my x1 which stays the same. I know that I must use a for loop. I renamed the workspaces as variables so it was easier to work with. Then I created a for loop with a variable i so it is easier to input. But I don't think I wrote the correct code because when I run the script, all I get is the graph of y2. I don't think this is the answer.
y1=Oxy_Hb_450_700;
y2=Doxy_Hb_450_700;
y3=Met_Hb_450_700;
x1=wavelength_450_700;
for i=10:10:90;
plot (x1, y1(:,end)*i + y2(:,end) * (100-i));
end
PLEASE HELP!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spectral Estimation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!