Using data calculated in matlab and stored as an array/1D matrix in Simulink

조회 수: 1 (최근 30일)
Hi
I am not sure what function block do I need to use an array. I basically have 25 values stored in 1-d matrix or array. I want to use a function block in Simulink that allows me to call upon these value stored under variable named "power". I tried using constant but that didn't work because this has more than one value.
I want to do further multiplication on all the values stored under variable "power" in Simulink during one timestep.
Thanks for the help

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 1일
You can use a constant block, just set the value to, for example
power=[1 2 3 4 5] % in workspace
Inside your block set the value to power
  댓글 수: 2
James Murray
James Murray 2014년 4월 1일
편집: James Murray 2014년 4월 1일
Thanks for the reply.
But when I try to use a function block to do arithmetic on this constant, I get no results. I am basically using two input signals and doing power*sin(u(2)).
I want to do this for all the values in power and than basically add them together to get one value.
Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 1일
What is power*sin(u(2)) ? Can you clarify your question?

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by