Undefined function or variable 'impact'.

1 回表示 (過去 30 日間)
Raad Alsulaiti
Raad Alsulaiti 2020 年 3 月 29 日
コメント済み: Raad Alsulaiti 2020 年 3 月 29 日
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 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by