Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
My scripts will not run when I click the run button.
조회 수: 1 (최근 30일)
이전 댓글 표시
For some reason, every time I try to hit the "Run" button for my script, the program exits the script and goes back to the Folder tab. I have tried restarting and it still doesn't work. How can this be fixed?
댓글 수: 5
KALYAN ACHARJYA
2020년 10월 1일
편집: KALYAN ACHARJYA
2020년 10월 1일
It's perfectly OK!
clc;clear all; close all;
x_points = linspace(-1,1,5);
y_points = linspace(-2,2,5);
[X,Y] = meshgrid(x_points, y_points);
%Find the dimensions of the array field by using the "size" command
s = size(X);
%Set x compomnent of ALL vectors to 1
v_x = ones(s);
% Plot the y component, where slope is the ODE
v_y = v_x .* (X + Y.*(1-Y));
% Define vector length
v_length = sqrt(v_x.^2 + v_y.^2);
% Recalibrate so all vectors are equal to 1
v_x = v_x./v_length;
v_y = v_y./v_length;
quiver(X,Y,v_x,v_y)
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!