How to get Matlab to calculate answers from linspace

4 visualizaciones (últimos 30 días)
Luke
Luke el 1 de Abr. de 2018
Respondida: Walter Roberson el 1 de Abr. de 2018
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Abr. de 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

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by