Answered
Why doesn't my code work correctly?
Because you mixed function handle in place of subs()/matlabFunction(). Try this: syms x1 x2 F=x1^2+x2^2-4*x1-2*x1*x2; gradx...

7 years ago | 0

| accepted

Answered
How call a variable from function to main body?
The best idea is to make the function with output with the variable that you want to use in the main body.

7 years ago | 0

Answered
Help with finding zeros of a complex function
Use fsolve(), vpasolve() or solve() and ezplot() or fplot() to view where the zero occurs..

7 years ago | 0

Answered
if column a=[1;2;3;2;5;2], b=[1;2;3;4;5;6] how many rows have a==2, i use this [a]=find(a==2) .
a=[1;2;3;2;5;2]; b=[1;2;3;4;5;6]; how_many_rows_have_2_in_a = nnz(a==2) corresponding_b_value_when_a_is_2 = b(a==2) Gives: ...

7 years ago | 1

| accepted

Answered
function and indexing erros
EDITED Addendum to sir Image Analyst and sir Walter's comments: upload your .mat file https://www.mathworks.com/matlabcentr...

7 years ago | 0

| accepted

Answered
How can i give inputs as a matrix ?
inputs=num2cell(randn(1,160)) a(inputs{:})

7 years ago | 0

| accepted

Answered
Draw 3D object. code this in 2016a version.help!
[x y] = meshgrid(-1:0.1:1); % Generate x and y data z = 1-x.^2; % Generate z data surf(x, y, z) % Plot the surface hold on [...

7 years ago | 0

Answered
How to use fsolve with a system of 2 nonlinear equations in a for that changes a parameter at each iteration
Note: Lots of parameters were not defined so please take care of it. %%different file %... % constant definitions %... V=-1...

7 years ago | 0

| accepted

Answered
How to import data into an array from a .txt file
Use readtable() to read the file

7 years ago | 0

Answered
What command does the same as find but including null elements?
v = [1 8 4 3 6 6 2 4]; desired_result=sort(v) Gives: desired_result = 1 2 3 4 4 6 6 8

7 years ago | 0

| accepted

Answered
Appending data with different sizes
aa = [1 2 3;4 5 6]; b = [1 2 3 4;4 5 6 7;6 7 8 9]; n=size(b,2); aa=zeros(size(a,1),size(b,2)); aa(:,1:size(a,2))=a(:,1:size(...

7 years ago | 0

| accepted

Answered
Continually prompt for the input of 3x1 column vectors
result=[label1(:) label2(:) label3(:)]

7 years ago | 0

Answered
Symsum not making the calculation
n=10000; % make n and k numerical k=10000; S3 = cumsum(((2-sqrt(3))^(k-2)+(2-sqrt(3))^(n+2-k)+(2-sqrt(3))^k+(2-sqrt(3))^(n-k))...

7 years ago | 0

Answered
Finding difficult to solve this coupled ode equations using ode45
Corrected equations , please clarify if something is not clear: % y(1)=>epsilon % y(2)=>sigma %dy(1)=>equation2 %dy(2)=>equa...

7 years ago | 0

Answered
Output formatting for symsum script
rewrite(S3,'sqrt') % usually this should work but it's not here

7 years ago | 0

Answered
Finding difficult to solve this coupled ode equations using ode45
Parameterize your function as below: P=10E12; b=0.268E-9; Q=285; M=3; K=1.38E-23; v=3.6E16; sigma_e=200; T=923; ...

7 years ago | 0

| accepted

Answered
I don't know why 'mean' function couldn't run with 'double'
Maybe the case that you have a file named mean.m if so change it's name or delete it . which mean -all % what shows up?

7 years ago | 0

| accepted

Answered
Data transfer from excel to matlab!
Use readtable() to read the excel file

7 years ago | 0

Answered
Solution of given Integration
gamma = @(A,B) A .* B .* cos( A.*B ) ; % an example how to proceed A = 4 ; B = 6 ; C = 10 ; fun = @(x) ( gamma( A , B .* x...

7 years ago | 0

Answered
How to import a csv file in matlab 2015b
fid=fopen('AQI Data.csv'); f=textscan(fid,'%s','delimiter','\n'); fclose(fid); celldisp(f)

7 years ago | 0

Answered
The following error occurred converting from sym to double: Unable to convert expression into double array.
t is a symbolic variable instead it has to have doubles (numbers): R = 35.9; L = 3.98; C = 0.000360; P = ceil(R/(2*L)); M = ce...

7 years ago | 1

| accepted

Answered
How to creating 3 nested for loop to obtain 3d matrix?
clc clear all u0 = 4*pi*(10e-7); y = 10e-3; x = 10e-3; z = 2e-3:0.1e-3:3e-3; alpha = 1:0.1:3; beta = 1:0.1:3; B=zeros(n...

7 years ago | 1

Answered
how can i creat an sub array with last n number of column of an array?
By indexing you can achieve it : s= [1 2 3 4 5 6 7 8 9 10 11 12 13 ...

7 years ago | 1

| accepted

Answered
Is there any code or command to generate Q(S(n))=n-1 Thanks.
Q(S==83) % an example S(Q==0)

7 years ago | 0

Answered
real and imaginary complex I(FFT)
real() imag()

7 years ago | 0

| accepted

Answered
Undefine 'openExample' function
openExample was introduced in 2016a and your using 2014b https://www.mathworks.com/matlabcentral/answers/276377-why-want-the-co...

7 years ago | 0

| accepted

Answered
From rk-2 to rk-4
https://www.mathworks.com/help/matlab/ref/ode45.html#bu0200e-1 If you want just downloadhttps://www.mathworks.com/matlabcentral...

7 years ago | 0

| accepted

Answered
function and indexing errors
Sir Wlater is right about calling function other than that there is indeed an error inside the loop: function Ls= WeLatente(WeS...

7 years ago | 0

| accepted

Load more