Vectors must be the same length
古いコメントを表示
I'm not sure what it means by "vectors must be the same length".
This is my code
i=1;
ct= 0;
Cmftct=0;
Coldct = 0;
Hotct= 0;
while (i <= n)
if (temps(i) <= 32)
Coldct = Coldct + 1;
elseif (temps(i) <=70)
Cmftct = Cmftct +1;
elseif (temps(i) <=99);
Hotct = Hotct +1;
else
Hotct = Hotct +1;
end
i = i +1;
end
figure(1)
x=[i : length(temps)];
y = temps;
plot(x, y, 'Marker', '^', 'Color', 'r', 'LineStyle', ':' ,'LineWidth', 2);
figure(2)
c = categorical(["# of cold Days", "# of Cold Days","# of Comfortable Days", "# of Hot Days"]);
b = [Coldct, Cmftct, Hotct];
bar(c, b);
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Call Python from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
