MATLAB: I dont get this; Unbalanced or unexpected parenthesis or bracket.; on the codes. What I did was putting’.’ next to high-lighted X,Y. for n=1:k T{n}=a(n)*sin(n*X.)*(exp(n*Y.)-exp(-n*Y.)); P; P=P+T{n}; surf(X,Y,T);grid hold onend Best Answer X. is not valid MATLAB syntax. You cannot use . as part of a variable name (although it can be used in some array operations).What do you think the period characters would do ?Use this:T{n} = a(n)*sin(n*X)*(exp(n*Y)-exp(-n*Y)); Related SolutionsMATLAB: I get “In an assignment A(:) = B, the number of elements in A and B must be the same.” error when I execute the following code. Do you need to index the sin(y) as as sin(y(n)) in this line:x(n+1)=(log(x(n)^2)-sin(y(n))+(3*x(n)/2)); MATLAB: Array indices must be positive integers or logical values. y(0) = 1; % y(i) = k; i must be a natural numberNot allowed in MATLAB.Instead writey(1) = 1; Related Question
Best Answer