symprod - error (again)
2 views (last 30 days)
Show older comments
I am reposting this, as the person who was originally looking into this is on break. I am using the student version 7.12.0.365 of MATLAB.
The goal of the code below is to create a pre-specified number of vortices, denoted by the entries V(i). The vortices are in complex form (i.e. x+i*y etc). I would like to be able to take the symbolic product of the vortices (specified by the parameter vort_num).
For example: if I have 2 vortices V = [ x + y*i, x - 1 + y*i], then I would like psi_0 to be their symbolic product. The only problem is that I would like to be able to change the number of vortices easily, so I was trying to use the symprod function. This way I could easily expand from 2 vortices to 10,so on and so forth.
This is not working: I am getting the follow error:
??? Undefined function or method 'symprod' for input arguments of type 'sym'.
The code is:
clc;
clear;
syms x y t k;
vort_num = 2 %Set number of vortices
A = ones(vort_num,3); %Construct a 3 row matrix consisting of each vortex parameter (A(row1),B(row2),E(row3))
V = sym(ones(1,vort_num));
for k = 1:vort_num
A(k,3)=k-1 %Set displacement to be equal between each vortex, moving in the positive direction on the x-axis for each new vortex
V(k) = A(k,1)*(x-A(k,3))+i*y*A(k,2) %Create complex form of each vortex
end
psi_0 = symprod(V(k), k, 1, vort_num); %Expand initial solution in polynomial form
I tried to change V to a symbolic matrix, but I am still having some issues.
Any help that you could provide could be extremely helpful.
Thanks Ima
3 Comments
Walter Roberson
on 17 Feb 2012
The message is not out of date: our year-end is March 31 and I still have much to do.
Andrew Newell
on 17 Feb 2012
How do you define "on a break"? You seem to be very active on this site still.
Answers (0)
See Also
Categories
Find more on Calculus 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!