Kindly guide how to add the single edit field for each RLC like [0.01, ...] and different time interval [10, 20, 30] in app designer and also the phase result on interfaces

조회 수: 1 (최근 30일)
Kindly guide how to add the single edit field for each RLC like [0.01, ...] and different time interval [10, 20, 30] in app designer

답변 (1개)

Divyajyoti Nayak
Divyajyoti Nayak 2024년 8월 7일
Hi @Ehtisham, from what I understand you want to get a numerical vector from an edit field when you enter a string like “[10,20,30]” into the edit field. You can make use of the ‘erase’ and ‘split’ functions to filter out the required numeric strings and then use the ‘str2double’ function to convert it into a numeric vector. Here’s a link to a similar MATLAB Answer:
Here’s the code that you can put in your button callback function:
RLC = app.RLCtoEC50EditField.Value;
RLC = erase(RLC,{'[',']'});
RLC = split(RLC,','); %Separate the elements by comma ','
%Do not use both space and comma to separate elements during input.
%If separating by space use below command instead
%RLC = split(RLC,' ');
RLC = str2double(RLC); %Convert string vector to double vector
%Similarly, do it for time intervals
Hope that helps!
  댓글 수: 7
Divyajyoti Nayak
Divyajyoti Nayak 2024년 8월 8일
@Ehtisham thats because the new edit field's name is not 'RLCtoEC50EditField'. You have changed it to 'RLCValuesEditField'
Ehtisham
Ehtisham 2024년 8월 8일
@Divyajyoti Nayak can you fix this problem and share a file with me. It will be very help ful for me

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

카테고리

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

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by