is my code below is correct?

2 visualizaciones (últimos 30 días)
Venkata Rama Krishna Gona
Venkata Rama Krishna Gona el 13 de Ag. de 2020
Respondida: KSSV el 16 de Ag. de 2020
Xp=zeros(f,2);
F=zeros(f,2);
Nu=zeros(1,f);
f=2;
i=1;
while i<=f
disp(['For force F01',num2str(i)]);
F0(i,1)=input('enter the amplittude of forces column matrix in row wise--');
i=i+1;
end
the need the code to store the matrices values as F011 and F012. please help me out.Thanks

Respuestas (1)

KSSV
KSSV el 16 de Ag. de 2020
Try this:
n=input('number of elements = ') % n = 4
for i=1:n;
a(i)=input('elements-'); % 1 2 5 7
end
a=reshape(a,n/2,n/2)' % not should be even for this example

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by