Error: Index exceeds matrix dimensions.

clear
clc
[num,txt]=xlsread('tire_ratings.xls');
ratings=num(:,1);
speed=num(:,2);
vehicles =num(:,3);
text=txt(1,1:3);
TR=triangulation(ratings,speed,vehicles);
size(TR)
%This is the error/output
Index exceeds matrix dimensions.
Error in ENG1102_11C (line 9)
speed=num(:,2);

6 comentarios

Andrew Newell
Andrew Newell el 2 de Abr. de 2015
I highlighted your code for you. In future, please select your code and click on the {} Code button.
Andrew Newell
Andrew Newell el 2 de Abr. de 2015
What size is num?
Star Strider
Star Strider el 2 de Abr. de 2015
Care to share ‘tire_ratings.xls’ with the rest of us so we can help you understand what the problem is? (Use the ‘paperclip’ icon, and remember to use both the ‘Choose file’ and ‘Attach file’ buttons.)
Cody Baumann
Cody Baumann el 3 de Abr. de 2015
I apologize for the inconvenience I have never have used any sort of a half forum before. I'll post the problem and the file.
Cody Baumann
Cody Baumann el 3 de Abr. de 2015
help*
Cody Baumann
Cody Baumann el 3 de Abr. de 2015
Load the values into a number vector called speed and a text matrix called txt . Use the size command to determine how many rows are in the text matrix. Extract all tire ratings and store them in a vector called ratings . Extract all vehicle types and store them in a vector called vehicles .

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 3 de Abr. de 2015
This works:
ratings=num(:,1);
speed=txt(:,1);
vehicles =txt(:,3);
The ‘num’ variable has one column, ‘txt’ has three, only 1 and 3 with any information.

Más respuestas (0)

Categorías

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 2 de Abr. de 2015

Respondida:

el 3 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by