How to split one input and perform different calculations on it to get different outputs.
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi everyone I am a Simulink novice, I was wondering if there is a block which take one input and performs different calculations on it and outputs them as separate outputs. So say I have 40 going in, inside the block there are different fractions to split the 40 ie, 1/2 1,4 1,6, I would have the answer to each of these fractions outputted as seperate ports on the block. Please help! Thank you!!
댓글 수: 0
채택된 답변
Ennio Condoleo
2017년 7월 27일
Hi, if I have correctly understood your issue, you have a number as a single input, and you would like to have multiple outputs given by a division of the number, right? We will be able to help you a lot if you could provide us a picture of your Simulink model. However, I will try to solve your problem.
Given: N (input) R1, R2, R3 the results from the blocks which divide N by a specified quantity.
You can use mux block to create an array signal from each Ri. For instance if you have M blocks, you will have M Ri. The Mux block allows you to create an array vector whose components are R1, R2, ..., Rm respectively. Then you can use a simple Scope to view the results on can exploit To Workspace block to retrieve the results in the base workspace and then plot them by using plot function. I hope this can help you!
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 String에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!