필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Why there is a mis-match when I do the summation of the elements of the vector in simulink function and workspace editor block??

조회 수: 1 (최근 30일)
I am performing the summaton of the elements of a vector in workspace and do the same in simulink function block but in workspace I am getting the correct result while in simulink function block i am getting the different result. Can any one guide me on this? I am using Matlab R019a

답변 (1개)

Dinesh Yadav
Dinesh Yadav 2019년 10월 3일
When importing data into Simulink using From Workspace block the first column always represents time. So lets say we imported an array from workspace of dimension 1x100, it will take the 1st column as time and rest 99 columns as input. Therefore the answer of summation of all values will not be correct. To correct this while importing into Simulink add the first column value as 0 which signifies, provide input data to Simulink at t=0. If we put first column value as lets say 4, then the output of summation will be observed at t=4.
  댓글 수: 1
Sandeep Nayak
Sandeep Nayak 2019년 10월 5일
matlab function.png
I defined this function in editor block and when I run it in workspace I am getting the correct result but in simulink when I call it I am getting different result. Thank you sir for your reply please guide me in this regards

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by