How can I use a parameter as string in Matlab Function Block?

조회 수: 1 (최근 30일)
Ezor
Ezor 2017년 1월 10일
댓글: Claudio Ferrara 2021년 12월 29일
Hello everyone,
I would like to use in a Matlab Block Function (in Simulink) an parameter (given in a mask). This parameter has to be a string (I use it in eval('base',my_string) ). My first thought was to NOT evaluate the parameter in the mask option but I still have this error
Do you know how I can use as it directly as a string? Hoping everything is clear despite my poor english,
Thanks in advance
"Expression 'names' for initial value of data 'names' (#164) must evaluate to a numeric or logical.
Right now, I bypass this issue by putting in the mask double('my_string') and then in the Matlab Function Block I do
char(my_string)
This is both ugly and boring since I have to type double('my_string') and note only my_string

답변 (1개)

Ezor
Ezor 2017년 1월 12일
No one has a clue?
  댓글 수: 1
Claudio Ferrara
Claudio Ferrara 2021년 12월 29일
5 years after your question and I have still the same doubt. How a simple thing like this could be so complicated

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

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by