help-octave
[Top][All Lists]
Advanced

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

Apply function to vector


From: Fritz Fischer
Subject: Apply function to vector
Date: Mon, 20 Jun 2011 11:59:55 +0200

Hello!

For convenient reasons to plot functions I would like to apply a function to a vector:

e.g.

x = 0:1:2*pi
y = sin(x)
plot(x,y)

So far, everything works fine.
But if I want to apply one of my functions the same way,
e.g.

x = 0:1:40
y = rayleigh_optical_density(x) %contains just some simple calculations

I get the following message:

error: for A^b, A must be square

I read about element-wise operations, but I guess this is of no use here, isn't it?

Can someone tell me what causes the problem?

Kind regards,






reply via email to

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