I want to calculate Re for each diameter value but I get this error ''unable to perform assignment because the left and right sides have a different number of elements.''.how can I fix this ? Sorry, Im beginner in matlab.

조회 수: 4 (최근 30일)
clear all clc
L=(2000+(5*50))
T=5+5*0.25
It=0.0075*L
ht=0.15*T
bt=0.50*It
e=0.0003*(5+50)
t=15000/sqrt(9.81/ht)
V=It*ht*bt
flwrt=V/t
D=0.1:0.01:0.5;
B=D'
iteration=1;
for D=0.1:0.01:0.5
v(iteration)=((4*flwrt)/(pi*D))
Re(iteration)=((v*D)/0.00000131)
iteration=iteration+1;
end

답변 (1개)

Image Analyst
Image Analyst 2021년 5월 16일
Lots of errors in your code. Try this:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 18;
L=(2000+(5*50))
T=5+5*0.25
It=0.0075*L
ht=0.15*T
bt=0.50*It
e=0.0003*(5+50)
t=15000/sqrt(9.81/ht)
V=It*ht*bt
flwrt=V/t
D=0.1:0.01:0.5;
B=D'
for iteration = 1 : length(D)
thisD = D(iteration);
v(iteration) = (4*flwrt) / (pi*thisD)
Re(iteration) = (iteration * thisD) / 0.00000131;
end
plot(Re, 'b-', 'LineWidth', 2);
grid on
xlabel('Iteration', 'FontSize', fontSize);
ylabel('Re', 'FontSize', fontSize);
fprintf('Done running %s.m ...\n', mfilename);
% End of main script.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by