[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: plotting question
From: |
Robert A. Macy |
Subject: |
Re: plotting question |
Date: |
Sat, 02 Dec 2006 08:06:50 -0800 |
You should tell the group what you're running and on what
platform.
However, I'm running octave 2.1.50 on Win98 and have
similar problem:
>> myscript
works well.
>> closeplot;
>> myscript;
plots only right side plot with no legend.
get no errors even in the gnuplot dialog.
had to exit octave and run it again.
no idea what's happening.
- Robert -
On Sat, 2 Dec 2006 16:38:11 +0100
Gergely CZUCZY <address@hidden> wrote:
> hello
>
> i'd like to do a plot, and it works fine for the
> first running of the script. after the first run,
> i close the plot window and whenever i try to execute
> the script again, no plot window appears. however, also
> no errors i got from octave.
>
> what am i doing wrong? the scriptfile si the following:
>
>
> --- BEGIN myscript.m ---
> sol=-10:0.1:10;
> tax=0.25;
> basesavings=5;
> moralexp=0.7;
> salar=0;
> savings=0;
> soleff=0;
> newsav=0;
>
> function salary = sol_salary(sol)
> salary = 9.2*(atan(sol/3)/(pi/2)).^3+15;
> endfunction
>
> function [soleff, newsavings] =
> expsav_solsav(expenditures, savings)
> sp_offset=-20;
> sp_scale=10;
> sp_b=0.1;
> sp_middle=16.7;
> spending =
>
atan(((savings.*expenditures)+sp_offset)*sp_b)*sp_scale+sp_middle;
> newsavings = savings - spending;
>
> sol_offset=-12;
> sol_scale=9.5;
> sol_b=.2;
> sol_middle=-2.412;
> soleff =
> atan((spending+sol_offset)*sol_b)*sol_scale+sol_middle;
> endfunction
>
> salary = sol_salary(sol);
> savings = salary+basesavings;
> [soleff,newsav] = expsav_solsav(moralexp, savings);
>
> subplot(1,2,1);
> plot(sol, salary, '-;sol->salary;');
> subplot(1,2,2);
> plot(savings, soleff, '-;soleff;');
> hold on;
> plot(savings, newsav, '-;newsav;');
> hold off;
> --- END myscript.m ---
>
> Bye,
>
> Gergely Czuczy
> mailto: address@hidden
>
> --
> Weenies test. Geniuses solve problems that arise.
- plotting question, Gergely CZUCZY, 2006/12/02
- Re: plotting question,
Robert A. Macy <=