Borrar filtros
Borrar filtros

Can anyone tell me what is wrong in this code?

2 visualizaciones (últimos 30 días)
Avinash Bhatt
Avinash Bhatt el 1 de Mayo de 2019
Editada: per isakson el 20 de Abr. de 2021
% success trial for small matrix
clc
clear all
close all
% Read matrix
X=pascal(3);
disp(X);
[r c]=size(X);
i=1;
%while i==c
for j=1:c
z=[X(i,j);X(i+1,j);X(i+2,j)];
disp(z);
end
i=i+1;
%end
breaks=[0 4 8 12];
pp=mkpp(breaks,X);
%ppn=vertcat(pp);
ppn=cell2mat(struct2cell(pp));
a=polyvalm(X,pp);

Respuesta aceptada

KSSV
KSSV el 1 de Mayo de 2019
coefs = pp.coefs ;
breaks = pp.breaks ;
peices = pp.pieces ;
order = pp.order ;
dim = pp.dim ;
  1 comentario
Avinash Bhatt
Avinash Bhatt el 2 de Mayo de 2019
Editada: per isakson el 20 de Abr. de 2021
After this code execution I am using polyval() to calculate the piecewise polynomial using
clc
clear all
close all
% Read matrix
X=pascal(3);
disp(X);
[r c]=size(X);
i=1;
while i ~= 4
for j=1:c
z=X(i,j);
disp(z);
end
i=i+1;
end
breaks=[0 4 8 12];
pp=mkpp(breaks,X);
coefs = pp.coefs ;
breaks = pp.breaks ;
peices = pp.pieces ;
order = pp.order ;
dim = pp.dim ;
%ppn=vertcat(pp);
%ppn=cell2mat(struct2cell(pp));
a=polyval(pp,4);
disp(pp);
Code not working. Please tell me what to do.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Polynomials 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