Cell array test in MATLAB Grader

I am preparing some exercises in MATLAB and some of the solutions might be indicated within cell arrays.
I have noticed that form some variables like transfer functions, space state models... the default value comparison is not effective and a MATLAB Code test must be used. Is it the same when using cell arrays?
Regards
Agustín

댓글 수: 4

Dyuman Joshi
Dyuman Joshi 2023년 10월 9일
What is the data inside the cell arrays that needs to be compared?
Numeric data, text data or something else?
Agustín
Agustín 2023년 10월 9일
Thnak you for you answer. Each cell element is a matrix, therefore I suppose it should be easy to handle by the default variable assesment.
Walter Roberson
Walter Roberson 2023년 10월 10일
I have seen people occasionally post that the State Space representation of a system is not unique. Is there a good way to figure out if two state space representations are equivalent?
Agustín
Agustín 2023년 10월 13일
In my case, as they have to get it from a ODE system of equations, I specify them the order of the state variables, and I compare the system matrices with an assert function as in this link, but changing the tf commands and members to the ss ones.

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2023년 10월 9일

1 개 추천

As Dyuman Joshi pointed out, it depends what you are storing in your cell array. If you store any variables that require a MATLAB Code assessment test to assess them (objects, transfer functions, etc), then you will need to write a custom assessment test to assess your cell array.
If you only store variables that the default 'Variable Equals Reference Solution' test type can assess, then you can use that same test to assess your cell array.

댓글 수: 1

Agustín
Agustín 2023년 10월 9일
Thank you Cris. Inside each cell I have matrices, therefore I could just use the usual 'Variable Equals Reference Solution', which should evaluate each cell array component.
As I have another case where the cells contain space state models I will implement a custom assessment for them.
Thank you again!

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2023년 10월 9일

댓글:

2023년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by