|
From: | Doug Stewart |
Subject: | Re: variable and plot |
Date: | Tue, 10 Apr 2018 10:20:36 -0400 |
Hello,
I am starting with octave.
2 questions.
1)
If I type this function under octave, it is fine,
but when it is in a file and that I make
source "myfile.m"
I get an error
error: 't' undefined near line 1 column 8
function y = f_LG (x, t, wD, g)
tt = t ./ wD;
y = exp (-tt .* tt) ./ ((x .- t).**2 .+ g .* g);
endfunction
2)
I have a function
function y = Voigt (x, wD, g)
y = quad (@(t) w (x, t, wD, g), -10,10);
endfunction
which seems to work
Voigt (0, 5, 0.1)
ans = 30.719
but, I cannot plot it
x=-10:0.1:10;
plot (x, Voigt (x, 4,0.1));
This gives me a constant value.
Thank for your help.
============================================================ ===============
Patrick DUPRÉ | | email: address@hidden
Laboratoire de Physico-Chimie de l'Atmosphère | |
Université du Littoral-Côte d'Opale | |
Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44
189A, avenue Maurice Schumann | | 59140 Dunkerque, France
============================================================ ===============
[Prev in Thread] | Current Thread | [Next in Thread] |