How to make a plot using two variables
2 views (last 30 days)
Show older comments
hamit Kenan on 2 Jun 2015
Answered: Salaheddin Hosseinzadeh on 3 Jun 2015
If you run this code you'll get graph shows natural frequencies. But i wanna see ten graphics in one figure as a result of changing "m2" value. ı have two matrices, K and M. im trying to change "m2" which is located M matrix. How can i plot natural frequencies with respect to w and m2 in one figure?
syms k1 k2 w m1 m2 L L1 b b1
A(s-2:s-1,s-2:s-1) = M
xlabel('w [rad/sn] ')
title('Sisteme Ait Doğal Frekans Grafiği')
Salaheddin Hosseinzadeh on 3 Jun 2015
I don't thin if you have any problem plotting in a loop, you just need to organize your data and address them with an appropriate index, have a loot at the code blow, its part of a code I wrote
for i = 1:size(PSFOffset,2)
for j = 1:size(PSFOffset,1)
title(sprintf(['PSF Ofsset: ',num2str(PSFOffset(j,i)), ' PSF length: ',num2str(estimatedWireDiam(j,i)),...
'\nAtten(dB): ', num2str(freqMagNullVal(j,i)),' DeconvRes: ', num2str(deconvResidueFactor(j,i)),...
'\nFuzzy Grade: ',num2str(fuzzyGrade(j,i))]));
There are two for loops as you see, what you can do is to locate a hold on after the plot command which is located inside a loop and get your graphs plotted.
Let me know if you need further info ;)
Find more on Subplots 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!