[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
plotting question
From: |
Gergely CZUCZY |
Subject: |
plotting question |
Date: |
Sat, 2 Dec 2006 16:38:11 +0100 |
User-agent: |
mutt-ng/devel-r804 (FreeBSD) |
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.
pgpepCG8CgFgw.pgp
Description: PGP signature
- plotting question,
Gergely CZUCZY <=