Answered
'trainingOptions' without 'trainNetwork' in deep learning
No. trainNetwork knows to use the options because you pass the options in. sgdmupdate does not permit you to pass in options so ...

3 years ago | 0

| accepted

Answered
Count number of unique symbols in an expression
With limits, present = cellfun(@(expr), ismember(dimen, symvar(expr)), param, 'UniformOutput', false) counts = sum(vertc...

3 years ago | 0

Answered
How can I change all numbers in matrix to 1? except for 0
logical(inputMatrix) However this will fail if the input includes nan

3 years ago | 0

Answered
how to access local files in MATLAB mobile?
Inside MATLAB Mobile, the upper left corner has three main horizontal lines on top of each other. Click on that. In the menu tha...

3 years ago | 0

Answered
Convert function handle to a function in ODE45
Do not do that. Instead use A = [1 2 3; 1 3 4; 7 6 5]; Jnew = matlabFunction(A*y(:) + J*y(:), 'vars', {y(:)}); ...

3 years ago | 0

Answered
Could anyone tell me why I am getting an error with "else" in my code. This is my first time using this software and I am very confused.
That code is not MATLAB code. MATLAB codes not use "endif" or "endwhile" or "end else". Also, MATLAB uses == for the comparison ...

3 years ago | 0

Answered
Hi, how should I display the name for image. Only Name without the pathways.
[~, imgName, extension] = fileparts(InfoImage.Filename); Then use either imgName alone or [imgName, extension] if you want to p...

3 years ago | 0

| accepted

Answered
residue number system in MATLAB
MATLAB can be used to program any deterministic calculation that can fit into your computer memory. MATLAB is Turing-complete: y...

3 years ago | 0

| accepted

Answered
why fft of an even and real signal in time domain gives imaginary part?
t = linspace(tmin,tmax,N+1); t(end) = [] ; Your signal must not return to origin in the final sample. You need a signal ...

3 years ago | 0

| accepted

Answered
Why am I only receiving one value for theta3 and alpha3, do I need to use a "for" loop instead?
/ is not the division operator in MATLAB. A/B is like inner product of A and the pseudoinverse of B. It is for solving systems o...

3 years ago | 1

Answered
While I am running this code I get this error, could anyone knows how to solve it ? (Unable to perform assignment because the size of the left side is 1-by-41 and the size of)
b_vec=zeros(i_max,1); That is a column vector b_vec(1,1)=40; b_vec(ny,1)=10; for i = 2:i_max-1 fo...

3 years ago | 0

Answered
the error of 'Matlab can only run a file with a valid name'
You have used the green Run button to try to execute code that is stored in a file that is not named like a valid MATLAB identif...

3 years ago | 2

Answered
i want to set x-axis to be in Pico seconds , how to do that
ax = gca; ax.XRuler.Exponent = -12;

3 years ago | 1

Answered
What's the meaning of the bitset in code generation ?
Suppose you have 3 logical values, say MA_on MB_on MC_on . Then at the C code level you could store those as one byte each, and ...

3 years ago | 0

Answered
How to stream data into Matlab workspace in real time
See https://www.mathworks.com/hardware-support.html?q=&page=1 for a list of hardware vendors and associated support information....

3 years ago | 0

Answered
Plot data above current axis
There are several possible ways to proceed: Create two different axes() specifying Position for each one, possibly using 'Units...

3 years ago | 0

| accepted

Answered
When I used "gamfit(data)", it says "X must be non-negative."
[r, c, s] = find(data<0); compose("Row %d column %d contains %g", r, c, s)

3 years ago | 0

| accepted

Answered
How to assign point name to points in an array and then plot them ?
A = [0,1.5+1.5i,4.5i,-6.75+6.75i,-20.25]; Anames = {'', 'start', 'impulse', 'peak', 'relax'}; Ar = real(A); Aim = imag(A); s...

3 years ago | 0

| accepted

Answered
Error when trying to play mp3 file
Your current directory is not one where old-victory-sound-roblox.mp3 can be found. It is recommended that you construct fully ...

3 years ago | 0

| accepted

Answered
How to find the average of 3D matrices in a cell?
The code you already have should work. Or you could use the more compact meanB = cellfun(@(b) mean(b,3), B, 'uniform', 0); If ...

3 years ago | 1

Answered
Particle Swarm Optimization PSO
nVar = 1 VarSize=[7 nVar]; % Size of Decision Variables Matrix Well that is wrong. You do not have 1 variable, you have 7 va...

3 years ago | 0

| accepted

Answered
Need help getting a code to solve for a variable changing in size with a matching number of equations
q_gen = 1*(10^5); Numeric T(1) = -196; That is a specific numeric value. X = 0:L/(M-1):L; That is a vector of numeric v...

3 years ago | 0

Answered
zeros of a matrix
You have accidentally created a variable with the name rand or the name size or the name zeros Also, to create a column of zer...

3 years ago | 0

Answered
Convert 8x3 char to string sequence (MATLAB)
reshape(val.', 1, [])

3 years ago | 0

| accepted

Answered
Empty plot returning when I try to graph
M = sigmayytheta0(rr); Every iteration in i and j, you are overwriting all of M. At the end, your M will be a scalar. You sh...

3 years ago | 0

Answered
Vectorizing unicode2native
%precompute L = false(1,MaximumPermittedCharacter) ; L(native2unicode(1:255,'windows-1252')) = true; %if you want to...

3 years ago | 0

Answered
How conv2 works?
conv2 does conv() and then transposes the result and does a second conv() and then transpose back. Each conv() step operates ...

3 years ago | 0

Answered
Not plotting the data
Your array cleanup has 4 rows and a fair number of columns. cleanup(:,2) is one column with of the 4 rows. You probably want to ...

3 years ago | 0

| accepted

Answered
how to plot a periodic function?
You do not need any loop. You generate one cycle based upon t1 t2 t3 t4 and piecewise(). Then you substitute mod(Time,t4) to the...

3 years ago | 0

Answered
how to make function
Example: syms x1 x2 x = [x1;x2] f(x) = (x1^3 - 2*x2^2 + 3*x1*x2 - 5)^3 + x1*x2 xstar = x * [-5 9] f(xstar(1,:), xstar(2,:))...

3 years ago | 0

Load more