How to write this b in matrix form

Respuestas (1)

Joseph Cheng
Joseph Cheng el 22 de Abr. de 2014
Editada: Joseph Cheng el 22 de Abr. de 2014
Look for the patterns and you can build these efficiently.
n=100;
b=1:n;
b=b.^2;
b=b/(n+1)^4;
b(1)=b(1)+1;
b(end)=b(end)+6;

3 comentarios

Sam
Sam el 22 de Abr. de 2014
Editada: Image Analyst el 22 de Abr. de 2014
Thanks but the b you gave me is the transpose of the b I needed. I think this code works for the b I need.
n = 100;
i = 2:(n-1);
bmid = i.^2 / ((n+1).^4);
b = [1+1/(n+1)^4, bmid, 6+(n^2)/(n+1)^4]';
Joseph Cheng
Joseph Cheng el 22 de Abr. de 2014
Editada: Joseph Cheng el 22 de Abr. de 2014
well i can't do everything for you. Talk about looking at a gift horse in the mouth. just transpose what i wrote or initialize b to be the correct size.
Sam
Sam el 23 de Abr. de 2014
Wow chill man. I wasn't telling you to do everything. I just didn't know how to write this as a matrix form in matlab, that's all.

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Sam
el 22 de Abr. de 2014

Comentada:

Sam
el 23 de Abr. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by