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

Guillaume
Guillaume 2016년 11월 15일
Z=[ 0, 0, 0][ 0, 1/16, 0][ 0, 0, 0] is not valid matlab syntax. So what is your input?
Omar
Omar 2016년 11월 15일
I got Z from this command Z=subs(S,{x,y} ,{X,Y}); which both x and y are independent variables in the function S while X and Y are just linspace(0,1,N)
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일

1 개 추천

iwant = double(Z) ;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Identification에 대해 자세히 알아보기

질문:

2016년 11월 15일

댓글:

2016년 11월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by