help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnuplot versus matlab plot: a suggestion


From: Søren Hauberg
Subject: Re: gnuplot versus matlab plot: a suggestion
Date: Mon, 16 Jul 2007 13:18:29 +0200
User-agent: Thunderbird 1.5.0.12 (X11/20070604)

Hi,
I don't understand quite what it is you're trying to do, but I have some thoughts for you anyway :-)

Instead of

plot( v, v*k , [styles{k}; ["frequency = " f "; "index = " k ";" ]

you should use

plot( v, v*k , [styles{k}; ["frequency = " num2str(f) "; "index = " num2str(k) ";" ]

that is convert numbers to strings. Otherwise use sprintf. So instead of

legend("frequency = %2.f   index = %d ", f, k )

use

legend(sprintf("frequency = %2.f   index = %d ", f, k ))

Hope that helps,
Søren

address@hidden skrev:
yes, this works

plot( v, v*k , [styles{i}, ";", names{i} ";" ]);

But i still cannot solve my problem. It is closer to

styles = {"+", "*", "o", "x", "r+"}
f = 10.3122
v = (1:1:10)'
for k = 1:5
    plot( v, v*k , [styles{k}; ["frequency = " f "; "index = " k ";" ]  )
endfor

or inside each look    legend("frequency = %2.f   index = %d ", f, k )

But i cannot get that working ...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]