How to i make the equivalent of the function scatter3 from matlab into Simulink ?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I am trying to plot a 3d point map using Simulink.
I have the x,y,z coordinates each as a 1 column matrix and using the function "scatter3(x,y,z);" i can plot easily the 3d point map i need. However i want to do it using simulink. I have searched on the internet and so far i didn't found anything to be useful. I am new at using Simulink so any answer helps.
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 5월 19일
You can call scatter3() from a MATLAB Function Block in Simulink.
You will probably want to use persistent to remember the axes handle.
댓글 수: 2
Walter Roberson
2019년 5월 19일
When you use "from workspace" you are importing a timeseries. "from workspace" of a numeric array treats the first column as times, and the remaining columns as a vector of values to become available at that time. There are two settings for "from workspace": you can either use sample and hold so that the value associated with time T is held exactly as-is until the time comes around for the next time in the data -- or you can use interpolation, so at times between there is a linear interpolation of values between the times given in the data.
Remember that Simulink signals are expected to vary with time.
If you are not computing the points during simulation, then you should be asking yourself whether it is really suitable to be displaying them during simulation, or if you should instead be displaying something that was computed. Sometimes it makes sense to display something pre-computed, such as if it is serving as a background plot upon which you are going to overlay things that are computed.
Remember that MATLAB Function Block can contain load() or evalin('caller') or evalin('base')
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!