필터 지우기
필터 지우기

How do I get the product in Matlab?

조회 수: 1 (최근 30일)
Ahmad Hijazi
Ahmad Hijazi 2018년 2월 15일
답변: Niwin Anto 2018년 2월 22일
Hello. Let's say I have: A=get_param('Name/Object1','Value') A=3.3 and B=get_param('Name/Onject2','Value') B=2 so A and B are extracted from Simulink blocks.
How do I make the product of both in Matlab?
I want to define C as the product so at the end I would get C=6.6 Thank you!!

답변 (1개)

Niwin Anto
Niwin Anto 2018년 2월 22일
The return value of the 'get_param' is character array. You can use 'str2num()' function to convert it double. Then you can take product.
A = str2num(get_param('Name/Object1','Value'));
B = str2num(get_param('Name/Onject2','Value'));
C = A * B;

카테고리

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