Effacer les filtres
Effacer les filtres

Could anyone help me to fix the issue.

2 vues (au cours des 30 derniers jours)
jaah navi
jaah navi le 30 Jan 2019
Réponse apportée : KSSV le 30 Jan 2019
code:
a=[1 2;
3 4;
5 6;
7 8]
data=2;
dimension=2;
a=a(:,1+data:dimension+data);
If i run this i am getting index exceeds matrix dimensions
could anyone explain what is meant by index exceeds matrix dimensions and how it can be solved with respect to the above code.

Réponse acceptée

KSSV
KSSV le 30 Jan 2019
You have two columns in a ...but you are trying to extract four columns...so the error...
a=[1 2;
3 4;
5 6;
7 8]
a=a(:,1:2); % no error
a = a(:,2:4) ; % error

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing 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