Changing a Matrix Format!

7 ビュー (過去 30 日間)
Omar
Omar 2016 年 11 月 15 日
コメント済み: Omar 2016 年 11 月 16 日
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 件のコメント
Jan
Jan 2016 年 11 月 15 日
It is still not clear, what Z is. Please post some code, which reproduces it.
Omar
Omar 2016 年 11 月 15 日
編集済み: Guillaume 2016 年 11 月 15 日
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)

サインインしてコメントする。

採用された回答

KSSV
KSSV 2016 年 11 月 16 日
iwant = double(Z) ;
  1 件のコメント
Omar
Omar 2016 年 11 月 16 日
Thanks man! I appreciate it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by