Code works in matlab command window, doesn't work in app designer code view

조회 수: 17 (최근 30일)
Mustafa Uslu
Mustafa Uslu 2021년 4월 7일
댓글: Mustafa Uslu 2021년 4월 8일
Hi all,
I have a Datamatrix A with size 393x171
from this I make a new matrix B with certain columns from matrix A.
B=A(:,2:5:68); size 393x14
and then from it only the maximum values in one column
B=max(B,[],2); size 393x1
If I write these codes in matlab command window, it works very well and no error.
If I write same codes in app designer code view, it doesn't work and give below errors.
B=A(:,2:5:68); --> Index in position 2 exceeds array bounds (must not exceed 1).
B=max(B,[],2); -->Error using max, Invalid data type. First argument must be numeric or logical.
Thank you in advance for your support.
Mustafa
  댓글 수: 6
Jan
Jan 2021년 4월 8일
The readers cannot guess that "Datamatrix A with size 393x171" means a struct array.
Mustafa Uslu
Mustafa Uslu 2021년 4월 8일
Hi Jan,
you have right, sorry for that, but I didn't know first;-)
Thank you anyway.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Management에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by