How to pass a vector to a function that creates matrix

1 次查看(过去 30 天)
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 ?

回答(1 个)

Matt J
Matt J 2020-1-15
编辑:Matt J 2020-1-15
>> b=[1 2 3]*10;
>> T=@(i) [b(i)+9 , 8 ; 8 , 7 ];
>> T(3)
ans =
39 8
8 7

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by