Error message with arrays
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
clear all
clc
close all
h = [2:20:220];
t_a = 293;
t_s = [];
q_flux = 800;
n = length(h);
for i = 1:n
t_s = q_flux./h+t_a;
y(i) = t_s;
i = i+1;
end
plot(h,y)
When running this i obtain the following error message:
Unable to perform assignment because the indices on the left side are not compatible with the size of
the right side.
Error in a2 (line 13)
y(i) = t_s;
what can i do different?
0 Commenti
Risposte (1)
Alan Stevens
il 26 Gen 2022
You only need
h = [2:20:220];
t_a = 293;
q_flux = 800;
n = length(h);
y = q_flux./h+t_a;
i = i+1;
plot(h,y)
0 Commenti
Vedere anche
Categorie
Scopri di più su Target & Compiler in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!