Azzera filtri
Azzera filtri

is my code below is correct?

1 visualizzazione (ultimi 30 giorni)
Venkata Rama Krishna Gona
Venkata Rama Krishna Gona il 13 Ago 2020
Risposto: KSSV il 16 Ago 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

Risposte (1)

KSSV
KSSV il 16 Ago 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

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by