Answered
Redirect output of MATLAB verbose function
fminbnd() supports optimset() options, including OutputFcn and PlotFcn . So you can program a PlotFcn -- which will be called w...

2 years ago | 2

Answered
how to express operators in symbolic algebra
MATLAB does not support creating operators: it only supports creating functions and expressions. For example, P^3 to represent ...

2 years ago | 1

Answered
i want to make inverse kinematics for 3 dof robot arm usnig Newton Raphson in matlap but i always get this error "(Not enough input arguments. Error in robo2 (line 2) )"
Reorder the parts. format long g x = 2; y = 3; z = 5; l1 = 10; l2 = 10; l3 = 4.5; epsilon = 0.01; t = compute_inv(x, y,...

2 years ago | 0

Answered
Arrays have incompatible sizes for this operation. Error in CDproydosverdos (line 28) Rx_sample = bsxfun(@times, x(t + lags), x(t)); Related documentation
t = linspace(0, T, 10001); %... x = A*cos(2*pi*fc*t + theta) + sqrt(N0)*randn(size(t)); x becames a 1 x 10001 T = 1000;...

2 years ago | 0

Answered
how can i create a smooth curve through data points
x=-0.6745:0.06745:0.6745; x1=-0.6499:0.06499:0.6499; x2=-0.5856:0.05856:0.5856; f=[21.0956 20.4078 19.6966 18.9596 18.1937 17...

2 years ago | 0

Answered
Fourier Series for odd integers only
symsum( (-1)^(k+1)*B(2*k-1), k, 1, inf)

2 years ago | 0

Answered
Error using fft Invalid data type.
Fo is a symbolic expression. fft() is only valid for numeric expressions. You can call fourier(Fo) . But... according to the...

2 years ago | 0

Answered
putting text of two lines in one cell in table
table() are not designed for presentation purposes. All of the methods for putting multiple lines into one cell result in displa...

2 years ago | 0

| accepted

Answered
Point array to generate meshgrid
Xu = uniquetol(X(:) ); Yu = uniquetol(Y(:) ); [Xg, Yg] = meshgid(Xu, Yu); F = scatteredInterpolant(X(:), Y(:), Z(:)) ...

2 years ago | 0

Answered
Problem with converted TIFF image
Use im2uint16

2 years ago | 1

Answered
Estimating the parameter of a complex equation using maximum likelihood estimation (MLE) method
The fval (residue) varies a lot, and the parameters vary a lot. The ga() call really should add in lower bounds and upper bound...

2 years ago | 0

Answered
Is it possible to see patternnet architecture as a plot?
There is just view(NET) where NET is the patternnet architecture. Unfortunately, analyzeNetwork() only applies to Layer array, ...

2 years ago | 1

| accepted

Answered
How to plot video frames along with entire audio and corresponding spectrogram for comparison in one graph?
There is a File Exchange contribution named VideoFig https://www.mathworks.com/matlabcentral/fileexchange/29544-figure-to-play-a...

2 years ago | 0

| accepted

Answered
Installed Symbolic Math Toolbox but cannot find \toolbox\symbolic\symbolic path
First, quit matlab. Second, uninstall Maple. You will find the uninstaller at the top level of the directory that Maple is inst...

2 years ago | 0

| accepted

Answered
Error when a function is running
You need to store that in a file to run it on MATLAB Online (or MATLAB Mobile)

2 years ago | 0

| accepted

Answered
How to plot these kind of line charts as shown in figures ? Any pointer will be helpfull
Those are a mix of plot() and either area or fill or patch() . fill() and patch() are easier to figure out, and have the advanta...

2 years ago | 0

| accepted

Answered
How can I associate complicated constraints in optimization problems using fmincon or intlinprog?
Use the nonlinear contraint function. f(x)-g(x)<=c translates into f(x)-g(x)-c <= 0 so return f(x)-g(x) Caution: nonlinear con...

2 years ago | 2

Answered
Simulink example files unable to open
The example runs for me. Note: examples are installed as part of the help documentation. Since R2023a the help documentation ha...

2 years ago | 1

| accepted

Answered
Hello. Could someone please suggest other components or blocks I can use to avoid using the step input block for the duty cycle?
Multiply the duty cycle (P) by 1.8 using a gain block.

2 years ago | 0

| accepted

Answered
Overplotting of scatter points on top of coastlines
As well as long placing the scatterm() on the bottom, you need to watch out for the face color, because the face normally blocks...

2 years ago | 1

Answered
2D Random Walk
for i = 2:N1 % Generate a random direction direction = rand(1, 2)*2*pi; % Update the position X1(i) = X1(i-1) + ...

2 years ago | 0

Answered
How to find gradient of a vector field in matlab symbolic
The fundamental problem you are having is that gradient does not accept a vector the first parameter. syms x y z syms u(x,y,...

2 years ago | 2

| accepted

Answered
How to change color of point depending on side of a line?
You can include scatter in a for loop. But there is a better way. state = ones(NumberOfPoints,1); state(X > AppropriateXV...

2 years ago | 1

| accepted

Answered
openExample('simscapeelectricalsps/GridConnectedPVArrayExample')
In previous releases (before R2023b) the command to invoke that example is ee_dual_active_bridge_control This requires Simscap...

2 years ago | 2

| accepted

Answered
Struggling to Solve 2nd Order ODE with Multiple Initial Values
syms R(r) eqn = diff(R,2) == R-R^3-(1/r)*diff(R); [eqs,vars] = reduceDifferentialOrder(eqn,R(r)) [M,F] = massMatrixForm(eqs,v...

2 years ago | 0

Answered
Function that makes Anonymous Functions
When an anonymous function is created and the function has reference to variables that are not named parameters, then MATLAB ins...

2 years ago | 0

Answered
Converting string scalar to written code
You can write text to a file using writelines() or by using fopen() / fprintf() / fclose(), or by using fopen() / fwrite() / fcl...

2 years ago | 1

| accepted

Answered
Starting with all symbols, ending with mixed symbols and number?
syms a b x %Expression y = (a/b)*x; newy0 = subs(y, [a b], [2 3]) newy1 = subs(y, [a b], sym([2 3], 'd')) newy2 = vpa(subs...

2 years ago | 0

| accepted

Answered
An issue with matlabFunction
matlabFunction can produce vectorized code only if all of the following are true: the expression is scalar for scalar inputs t...

2 years ago | 0

Answered
how to define greek letter as syms in matlab?
MATLAB does not permit using greek characters as variable names. \ expressions cannot be used as variable names. However if yo...

2 years ago | 1

Load more