getting arrays into matrix

조회 수: 11 (최근 30일)
Vilmos Popelyak
Vilmos Popelyak 2022년 5월 12일
답변: Binaya 2023년 11월 2일
hi all, newbie here. working on an RT60 calculator in the app creator, and i'm trying to arrange several arrays into one matrix, but i keep getting an error message for it, and i can't seem to figure out why it doesn't work. here's a screenshot of it. please help
  댓글 수: 7
Vilmos Popelyak
Vilmos Popelyak 2022년 5월 12일
the 'dbstop if error' came back with this message besides the original error message:
rethrow(exception);
In base workspace.
Jan
Jan 2022년 5월 12일
편집: Jan 2022년 5월 12일
@Vilmos Popelyak: Of course it does. This is the purpose of the dbstop command. When Matlab stops at the error, you can examine the locvally used variables and find out, why the index is not a positive integer.
If this code is encapsulated in y TRY/CATCH block, this command stops Matlab more powerful:
dbstop if caught error

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

답변 (1개)

Binaya
Binaya 2023년 11월 2일
Hi Vilmos,
Based on your description, it seems that you want to address an error that occurs when executing the code, specifically the error message "Index in position 1 is invalid. Array indices must be positive integers or logical values."
Upon reviewing the provided code, it appears that the error arises from passing the value of the "LeftwallmaterialDropDown" as an index to an array using the function str2double().
To resolve this error, please ensure that the value selected in the "Leftwallmaterial" drop-down menu in the app designer is not a character, negative number, zero, or a fractional number. These types of values are not valid as array indices.
I hope this helps.
Regards
Binaya

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by