nonconformant arguments, Array substitution
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
data = dlmread('C:\Users\Acer\Desktop\project hydro\Offset.txt');
disp(data)
prompt = "\nEnter the value of wl? = ";
x = input(prompt);
wl= data(2:x+2,1)
Breadth= data(2:x+1,2) %input wl
Area=[1;4;2;4;2;4;2;4;1].*Breadth;
disp(Area);
TotalArea=sum(Area)
%How do i get the array i made to multiply with the array for area
0 Kommentare
Antworten (1)
Walter Roberson
am 28 Jun. 2022
You cannot. Breadth is a column vector of length x. [1;4;2;4;2;4;2;4;1] is a column vector of length 9. You cannot multiply those together unless x is 1 or 9.
I suspect that you should be looking at trapz()
0 Kommentare
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!