0
votes

I have a matlab code and wants to convert into appropriate Simulink model. However i'm new to Simulink, having only Matlab experience. Please Guide me to convert to appropriate model.

 t=(0:1000)/1000*10*pi; 
    x = (t).*sin(t);
    y = (t).*cos(t);
    z = t;



  plot3(x,y,z,'c') ;
    h=line('Color',[1 0 0],'Marker','.','MarkerSize',40,'EraseMode','xor'); 
    n=length(x);
    i=1;
    while n                          
      set(h,'xdata',x(i),'ydata',y(i),'zdata',z(i)); 
       drawnow;                                             
       pause(0.0005)                                            
       i=i+1;

    end

I followed following steps to design model of refer to signal generation model in Simulink from matlab

t=(0:1000)/1000*10*pi; 
x = (t).*sin(t);
y = (t).*cos(t);
z = t; 

the question is how to I set the step 1 from reference and also, how to give the output to VR SIGNAL EXPANDER in order to move VR Ball in the output generated path. ?

1

1 Answers

1
votes

You can make your 3 signals in the simulink simply like this:

enter image description here

  • you can open a scope and go to the settings and then change the number of axis from 1 to 3.

Then add one VR Expander for each signal:

enter image description here

in your case because the translation vector is a 3x1 vector, you need to change the Output width value in the VR Expander to 3 and the input signal indices to [2] because here we care about the second input which is y. It is explained well in this video.

to change the view, there are enough controls and buttons in the VR viewer. you can move right, left, top, down, ....

in the last case you mentioned you need to add a product to the simulink to make a new spiral motion. enter image description here