Not enough input Arguments Error & error in Height

조회 수: 5 (최근 30일)
Daniel Louw
Daniel Louw 2022년 4월 9일
답변: KSSV 2022년 4월 9일
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)));

답변 (1개)

KSSV
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:
  1. Dont name variables on the function names.
  2. DEfine the variable height value and assign it to different variable.

카테고리

Help CenterFile 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!

Translated by