help-octave
[Top][All Lists]
Advanced

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

Re: help with example script to run


From: Nicholas Jankowski
Subject: Re: help with example script to run
Date: Tue, 7 Nov 2017 20:31:24 -0500



On Nov 7, 2017 7:10 PM, "Leo Baumann" <address@hidden> wrote:
Hello,

A little script from internet. I am desperate newbie. -

error: 'talbot_inversion_sym' undefined near line 5 column 11

Is it posible that someone helps me?

Thanks - Regards Leo

script:

#-------------------------------------------------------------------------------------------------------------------------------

clear all;
clc;
t = 0.1:0.1:6*pi;
w = pi;
results = talbot_inversion_sym(@(s) s/(s^2+w^2), t, 128);
plot(t, cos(w*t), ...
     t, results, '.');
axis([t(1) t(end) -2 2]);
xlabel('Time'); title('f(t) = cos(\pi t) from f(s) = s/(s^2+\pi^2)');
legend('Known Function', 'Approximation');

#------------------------------------------------------------------------------------------------------------------------------------

function ilt = talbot_inversion_sym(f_s, t, M, P)

<snip>

You're running a  script with a user defined function, but you're calling the function before it gas been defined. I think MATLAB very recently has started allowing this, but octave does not.

It should run if you save the function portion as a separate file (talbot_inversion_sym.m) 

It looks like function says that it requires the symbolic toolbox, so you'll have to make sure that's installed and loaded before running.

reply via email to

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