How to pass a vector to a function that creates matrix

1 visualización (últimos 30 días)
montasir Tahir
montasir Tahir el 15 de En. de 2020
Editada: Matt J el 15 de En. de 2020
b=[1 2 3];
T=inline('[b(i)+9 8;8 7]' , 'i')
I'm trying to make a matrix that works like this:
I input T(i)
so that the output will be :
b(i)+9 8
8 7
how can i do that ?

Respuestas (1)

Matt J
Matt J el 15 de En. de 2020
Editada: Matt J el 15 de En. de 2020
>> b=[1 2 3]*10;
>> T=@(i) [b(i)+9 , 8 ; 8 , 7 ];
>> T(3)
ans =
39 8
8 7

Categorías

Más información sobre Data Types 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!

Translated by