How to get Matlab to calculate answers from linspace
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I want to calculate the temp change from years 1 to 5; however I keep getting nothing when I run the code. Would appreciate any help.
T0 = 473.15; %initial temp
r = 10; %cooling in C per year
t = linspace(0,5,1); %trying to find temp change from years 1-5 for each year
T = T0-r.*t; %equation
0 Commenti
Risposta accettata
Walter Roberson
il 1 Apr 2018
You have
linspace(0,5,1)
linspace(A, B, C) requests that you take a total of C point starting from A and ending at B (inclusive in both cases.) So you are asking for there to be only 1 point.
If you want integer year numbers use 1:5
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices 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!