How to fix error "Error using reshape To RESHAPE the number of elements must not change." when I am using pdegrad?
Show older comments
How to fix error "Error using reshape To RESHAPE the number of elements must not change." when I am using pdegrad?
I want to calculate du/dx and du/dy by using pdegrad:
[ux,uy] = pdegrad(p,t,u);
Then I got error above. I wrote edit reshape on the command line, and it tells me that when I want to reshape u using function uu=reshape(u,np,N), I have to make sure my u has np by N elements. I checked my u elements size is 832 by 41 where 832 is my solutions from the nodes points and 41 is my tlist. Then on pdegrad function, it defines N=size(u,1)/np, where size(u,1) is 832 and np is 832 since it only has 1 partial derivative equation so N is 1. Therefore my u has a size of 832 by 1.
Is there any way to fix this error or other way to calculate the du/dx and du/dy?
Thank you, Bella
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!