Acessing numerical matrix in symsum function
이전 댓글 표시
Hello,
I'm having some trouble trying to run this code
clc;
clear;
close all
%%Imagem
IM = [1 2 3; 4 5 6; 7 8 9]
im = sqrt(-1);
%%Data
ind = 3;
omeg = 2^(-((ind+2)/2));
sig = (2*pi^2)/omeg;
thet = 0;
%%first
% J = sum(0,k)[f(k,y) H(x - k) S(x-k)
y = 0;
syms k x
%soma = IM(y+1,k+1)*exp(im*omeg*sin(thet))*exp(-0.5*((x-k)/sig)^2);
J0 = symsum(IM(y+1,k+1)*exp(im*omeg*sin(thet))*exp(-0.5*((x-k)/sig)^2), k, 0, 3)
I got the following error:
Error using sym/subsindex (line 766) Invalid indexing or function definition. When defining a function, ensure that the arguments are symbolic variables and the body of the function is a SYM expression. When indexing, the input must be numeric, logical, or ':'.
How can I get values from a numeric matrix in symbolic sum?
Thank you
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Code Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!