- Dont name variables on the function names.
- DEfine the variable height value and assign it to different variable.
Not enough input Arguments Error & error in Height
5 ビュー (過去 30 日間)
古いコメントを表示
Greetings,
I am quite new to MatLab. I keep getting the "not enough input arguments" error for this code. When I try to look up errors for this, I usually find the problem with people's code is in defining their functions, but I am not using any functions in this code.
I get the error "not enough input arguments" as well as "error in height", which I don't understand because I am not defining a height? I assume it is refering to the column in the excel file but column 11 is complete and the same length as the other columns and I've had no errors with them.
Any help would be appreciated.
Daniel
clc; clear; close all
table = readtable('wood_1');
original_L = 21.5;
time = table{:,1};
load = table{:,2};
position = table{:,3};
stress = table{:,11};
strain = position/original_L;
thickness = 1.01;
length = 21.5;
width = 1.48;
loadspacing = 5.386666667;
testload = load(5103);
MoR = ((testload/2)*(loadspacing/2) * (thickness/2) / (((width*height)/12)));
Error message:
Not enough input arguments.
Error in height (line 10)
H = size(X,1);
Error in Lab9 (line 44)
MoR = ((testload/2)*(loadspacing/2) * (thickness/2) / (((width*height)/12)));
0 件のコメント
回答 (1 件)
KSSV
2022 年 4 月 9 日
Note that height is a inbuilt function. You have not defined the variable height which is defined in the line:
MoR = ((testload/2)*(loadspacing/2) * (thickness/2) / (((width*height)/12)));
As the variable is not defined, it is expecting to use a inbuilt function, for this function input should be a table and as there is no input it is throwing error.
What to do:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Scope Variables and Generate Names についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!