Azzera filtri
Azzera filtri

Assigning some matrices to 1 matrix

1 visualizzazione (ultimi 30 giorni)
Hamid
Hamid il 3 Nov 2014
Commentato: Hamid il 4 Nov 2014
Hi,
I want to assign some matrices to 1 matrix that can be represent 6 matrices.
for example for 3 matrices: f1=[100 0 100]; f2=[500 100 0]; f3=[0 300 300]; f=[? ? ?]
What can I do?????
I got stuck for 2 month, please help.
thanks.
  1 Commento
Adam
Adam il 3 Nov 2014
You definitely shouldn't be stuck for 2 months on something like this! If you state a problem clearly enough as you did here you should get an answer within a few hours on this site in general so don't just stay stuck for that long, though obviously do try things yourself first.

Accedi per commentare.

Risposta accettata

Adam
Adam il 3 Nov 2014
Are all your matrices the same size - i.e. 1-by-3?
If so then
f = [f1; f2; f3;...; fn];
will work to give you an n-by-3 matrix where each row is one of your fn.
Ideally you don't want to have variables named as f1, f2, f3, etc in the first place though so if possible put the data into this single matrix format straight away without the need to combine multiple variables like this.
  3 Commenti
Adam
Adam il 3 Nov 2014
How do you want it to combine f1, f2, etc in that case?
If they are all 1-by-3 and you want f to be a 1-by-3 combination of them then you will need to either sum then, average them or some other mathematical operation to combine n results into 1 result of the same size.
Hamid
Hamid il 4 Nov 2014
that is not what I want but I think there is no way to solve problem.
thanks anyway Adam.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by