what is the probleme exactly u must be of size[3,20] but i find it [3,1]

조회 수: 1 (최근 30일)
KARIM MANSOUR
KARIM MANSOUR 2021년 1월 12일
댓글: KARIM MANSOUR 2021년 1월 12일
function [u] = suite(A,b,u1,nb)
[n,n] = size(A);
u=u1;
for i = 1 : nb
u= A*u +b;
end
end
A=[5/8 -1/4 1/8;1/4 0 1/4;1/8 -1/4 5/8];b=[1;-1;1];u1=[5;2;-4];m=20;p=m;
u=suite(A,b,u1;b)

답변 (1개)

Jan
Jan 2021년 1월 12일
Let me guess boldly: You want:
A = [5/8, -1/4, 1/8; 1/4, 0, 1/4; 1/8, -1/4, 5/8];
b = [1;-1;1];
u = [5; 2; -4];
m = 20;
u = suite(A, b, u, m)
function u = suite(A, b, u, m)
for i = 1 : m
u = A*u + b;
end
end

Community Treasure Hunt

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

Start Hunting!

Translated by