Effacer les filtres
Effacer les filtres

I need to make a table out of a large matrix. Help?

1 vue (au cours des 30 derniers jours)
Aaron Zorzi
Aaron Zorzi le 18 Fév 2016
Commenté : Aaron Zorzi le 18 Fév 2016
I have a 280x3 matrix of values, and I need to make a table out of 10 points from them that fall between the rows that include -10 and 10, which are the 21st and 221st rows, respectively. My teacher gave us this hint:
Hint: Once you know which row has the -10 and 10 AA Temp degree you can use floor(linspace(r1,r2,N)) where r1 = the row with -10 and r2 = the row with 10. This will give you the row locations for N points which span the range are not quite equally spaced but close. Use these locations to get your AA Tire temperatures and the deflection values.
However, I am trying to use this command and it is not working. I'm getting really frustrated; all I'm trying to do is make a table. Please help?
M = xlsread('tire_lab');
T = floor(linspace(M(21,:),M(221,:),10))
  2 commentaires
John BG
John BG le 18 Fév 2016
hang the Excel file so the readers can have a look
Aaron Zorzi
Aaron Zorzi le 18 Fév 2016
here you go

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 18 Fév 2016
Either use a loop to linspace row by row, or substitute equivalent logic without linspace.
linspace(r1, r2, 10)
for row vectors r1 and r2 to be taken as pairs, can be calculated as
LS = (repmat(r1,10,1) + bsxfun(@times, (0:9).'/10, (r2-r1))).';
This will give you a length(r1) by 10 array ready to be further processed.
  2 commentaires
Walter Roberson
Walter Roberson le 18 Fév 2016
I would note, by the way, that the problem description is almost certainly talking about row numbers r1 and r2, rather than row contents
Aaron Zorzi
Aaron Zorzi le 18 Fév 2016
When I try to do linspace(r1,r2,10) it tells me that the matrix dimensions don't agree and won't allow me to do anything else. What's wrong with it?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by