Finding corresponding values between array
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
JaffaCakes
el 28 de Abr. de 2021
Comentada: JaffaCakes
el 28 de Abr. de 2021
Hi, Suppose I have any matrix A(1,j) where j is columns
and t from 0:5:30
and for each value of t I have a corresponding j value
so e.g. t= 0 5 10 15 20 25 30
and j= 1 11 21 31..... corresponding to the t values.
How can I find an element within matrix A, corresponding to each of j values (columns)?
I've tried to do something like this so far,but it didnt work.
t= 0 5 10 15 20 25 30
j= 1 11 21 31.....
v=length(t)
for k=1:v
y=A(1,J(v))
end
0 comentarios
Respuesta aceptada
Steven Lord
el 28 de Abr. de 2021
I'm not certain I understand your question. Let's take a concrete example. Can you tell us what the answer you'd want to receive for this example is and how you calculated that answer?
t = 0:5:30;
j = 1:10:61;
A = (1:61).^2;
Is it as simple as indexing?
y = A(1, j)
results = table(t.', j.', y.', j.'.^2, ...
'VariableNames', ["t", "j values", "y values", "j^2 to check"])
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!