I'm having an issue with ubdefined variable I'm using 2015b.
I knew there's some veriable wont work on older version, is it because of the version of my matlab.
or did I miss something.
clc;
clear;
g = 9.81;
theta = 33;
vel = zeros(1,10);
tim = zeros(1,10);
AC = zeros(1,10);
i = 0;
for a_c = 1*g:g:10*g
i = i + 1;
AC(i)=a_c;
I = impact(a_c,theta);
vel(i) = I;
tim(i) = 0.75/I;
end
figure
subplot(1,2,1)
ploy(AC,vel)
title('impact velocity vs acc.');
xlabel('acc');
ylabel('Velocity');
subplot(1,2,2);
ploy(AC,tim)
title('Time vs acc.');
xlabel('acc');
ylabel('Time');
Error:
Undefined function or variable 'impact'.
Error in Untitled8 (line 12)
I = impact(a_c,theta);

댓글 수: 2

Walter Roberson
Walter Roberson 2020년 3월 29일
편집: Walter Roberson 2020년 3월 29일
impact() is not a Mathworks function that I can find. I also do not find it in any File Exchange contributions.
Looking at your code, I think you are expected to write the function yourself.
Raad Alsulaiti
Raad Alsulaiti 2020년 3월 29일
that's good enough for me, thanks.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2020년 3월 29일

댓글:

2020년 3월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by