Why do i get a blank graph?
조회 수: 32(최근 30일)
표시 이전 댓글
Hello, as you can see in the code below I am trying to make two plots but the problem is that the subplot (2,1,2) goes blank. I got nothing. I think maybe there is something wrong with the variables k1 and v1 since they depend on X(1) and X(3) which come from the solution of an ODE. Can somebody help me? Thanks in advance.
function [T,X] = call_osc()
tspan = [0 2000];
odeset('RelTol', 1e-10, 'AbsTol', 1e-12);
[T,X]=ode15s(@osc,tspan,[x1_0 x2_0 x3_0 x4_0]);
댓글 수: 1
gonzalo Mier 2019년 6월 2일
편집: gonzalo Mier 2019년 6월 2일
You are computing v1 as
v1 is a matriz of size 1x1. So when you do plot( "vector of size 1xn" , "cte" ) the output is an empty plot.
Check if the way to compute v1 is correct or you have to use X(:,1).
PD: You also can check this doing:
댓글 수: 3
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!