help-octave
[Top][All Lists]
Advanced

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

How to prevent "error: A(I, J) = X: X must be a scalar..." with working


From: lynx . abraxas
Subject: How to prevent "error: A(I, J) = X: X must be a scalar..." with working matlab code
Date: Tue, 31 Jul 2007 09:23:20 +0200
User-agent: Mutt/1.5.11

Hello!


I'm  having  troubles  getting  working  matlab  code to be run with octave. I
couldn't find an answer to my problem in the archive or the net  although  I'd
say it should be quite popular.
Anyway octave can't handel this:

u= linspace(0,1,P)
x1(:,1)= 0.5.*(u)-0.5

It complains:
error: A(I, J) = X: X must be a scalar or the number of elements in I must
error: match the number of rows in X and the number of elements in J must
error: match the number of columns in X
error: assignment failed, or no method for `<unknown type> = matrix'

If  I  do x1(1,:)= 0.5.*(u)-0.5 all is fine. Having to rewrite the matlab code
would be a pain. Is there an easier way to get it to work with octave?

Thanks for any answers.
Lynx

ps. I'm not in the list.




reply via email to

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