help-octave
[Top][All Lists]
Advanced

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

Re: malpractice at num2str + title


From: Benson Muite
Subject: Re: malpractice at num2str + title
Date: Sat, 4 Jul 2020 10:55:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 7/4/20 10:46 AM, Fumio Hakamada wrote:
t = 1:100;
figure
for n=1:4
     subplot(2,2,n)
     a = " deformation - force, n=" + num2str(n);  % no for OCTAVE
     y = sin(2*pi*n*t/100);
     plot(t,y);
     title(a)
end

Try

t = 1:100;
figure
for n=1:4
    subplot(2,2,n)
    a = strcat(" deformation - force, n=", num2str(n));
    y = sin(2*pi*n*t/100);
    plot(t,y);
    title(a)
end




reply via email to

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