From: Rahul Uk on
Are we able to enter elements to a variable while running a
loop as in C/C++?????
From: Rahul Uk on
"Rahul Uk" <rauluk23mj(a)gmail.com> wrote in message
<fvrnpj$j35$1(a)fred.mathworks.com>...
> Are we able to enter elements to a variable while running a
> loop as in C/C++?????
Basically is it possible to enter values at runtime in matlab???
From: Jos on
"Rahul Uk" <rauluk23mj(a)gmail.com> wrote in message
<fvro4u$7u6$1(a)fred.mathworks.com>...
> "Rahul Uk" <rauluk23mj(a)gmail.com> wrote in message
> <fvrnpj$j35$1(a)fred.mathworks.com>...
> > Are we able to enter elements to a variable while running a
> > loop as in C/C++?????
> Basically is it possible to enter values at runtime in
matlab???


Yes, for instance using input

a = 1 ;
while a > 0,
a = input('Enter a number (0 to quit): ') ;
disp(['Your number squared equals ' num2str(a*a)])
end

hth
Jos