help-octave
[Top][All Lists]
Advanced

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

Re: Variables ...


From: antonio palestrini
Subject: Re: Variables ...
Date: Thu, 18 Jan 2007 15:52:47 +0100

Is there a way to use a variable without assigning it a value first…
 I want to have a matrix like that:
 Χ = [(a+2) 3 4; 5 (a-4) 8; 3 2 (a-1)]
 But, when I use "global a", octave outputs a matrix which is not 3*3…

which is exactly the output?
A simple solution (I know too simple to be interesting for the smart
users of octave) is to write
a function

function y = X(a)
 y = [(a+2) 3 4; 5 (a-4) 8; 3 2 (a-1)] ;
endfunction

antonio

--
Prof. Antonio Palestrini
DSGSS - University of Teramo, Italy
e-mail: address@hidden


reply via email to

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