Filter löschen
Filter löschen

Changing a Matrix Format!

4 Ansichten (letzte 30 Tage)
Omar
Omar am 15 Nov. 2016
Kommentiert: Omar am 16 Nov. 2016
Hi everyone, can somebody help me to reshape my matrix from this format Z=[ 0, 0, 0][ 0, 1/16, 0][ 0, 0, 0] to this format Z=[0,0,0;0,1/16,0;0,0,0]???
  4 Kommentare
Jan
Jan am 15 Nov. 2016
It is still not clear, what Z is. Please post some code, which reproduces it.
Omar
Omar am 15 Nov. 2016
Bearbeitet: Guillaume am 15 Nov. 2016
okay, Here is my code
clear all;clc;close all;
syms x y
f=x*y*(1-x)*(1-y);
syms m n pi
a=4*int(int(f*sin(m*pi*x)*sin(n*pi*y),y,0,1),x,0,1); S=symsum(symsum(a*sin(m*pi*x)*sin(n*pi*y),n,1,2),m,1,2);
xx=linspace(0,1,3)';yy=xx;
[X,Y]=meshgrid(xx,yy);
Z=subs(S,{x,y} ,{X,Y});
figure
surf(X,Y,Z)

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 16 Nov. 2016
iwant = double(Z) ;
  1 Kommentar
Omar
Omar am 16 Nov. 2016
Thanks man! I appreciate it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by