Answered
Can it be possible to use a for loop to precise the code
%%% The following lines need to be in squeezed so that it will save time (using for loop) Using a for loop is only faster th...

3 years ago | 0

| accepted

Answered
Can we use standard deviation of color image as a contrast value?
That particular kind of contrast is called RMS contrast; there are other contrast measures as well. https://en.wikipedia.org/wi...

3 years ago | 0

| accepted

Answered
How can I calculate ln(x) in matlab code?
There seems to be some conception that "ln" is the "right" way to take natural logarithm, and that MATLAB is... deficient... bec...

3 years ago | 9

Answered
houw can I get the number of terms?
First realize that the sum of 2 cube + 4 cube + 6 cube and so on, is 2 cube times (1 cube + 2 cube + 3 cube +...) Now look u...

3 years ago | 0

Answered
'Unable to concatenate the table variables 'Var1' and 'Var2', because their types are cell and double.' why this error is showing?
Your file contains a mix of text and numeric. What result are you expecting when you ask to convert it to a single array?

3 years ago | 1

Answered
why plot line style not change?
you are plotting only one point at a time. plot() only draws lines when there are at least two adjacent finite coordinates in a ...

3 years ago | 1

Answered
Arrazy size problem at line 24
P= (-m)*(Acc); p=fft(P); m is a scalar and Acc has 6 elements so P has 6 elements. fft with one parameter returns someth...

3 years ago | 0

Answered
Summing over indices using symsum
You cannot use a symbolic variable as an index. I think it is unlikely that it will ever be supported to use symbolic variable...

3 years ago | 1

Answered
can we make 3D mash plot from eq y(x)
syms x theta g=9.81; v0=25; y0=1; fun = (-1)*(tand(theta)*x-(g/(2*v0^2*cosd(theta)^2)*x.^2)+y0); fsurf(fun, [0 300, 0 90]...

3 years ago | 0

Answered
Pre-built functions suddenly became undefined in app designer?
if timerfind() returns empty then it is [] that it returns rather than an empty array of class timer. And stop([]) does not work...

3 years ago | 0

Answered
make function to plot countour and 3D
f=@(X,Y) 2+X-Y+2*X.^2+2*X.*Y+Y.^2; plot3dfunc(f,-2,0,0,3) function plot3dfunc(f,Xmin,Xmax,Ymin,Ymax) x=linspace(Xmin,Xmax,5...

3 years ago | 0

| accepted

Answered
Add an image to subplot
axis image after you display the plot. This will set the aspect ratio to square so that the image does not get streched wide.

3 years ago | 1

| accepted

Answered
1*0 empty double row vector
19 < X is never true, so find() is going to return empty. What result were you hoping for in the case where the input value is ...

3 years ago | 0

Answered
Help in writing a a code for an array based on comdition.
See sum sign However, your description does not match your example. You say you want to replace positive numbers with 1, but yo...

3 years ago | 0

Answered
Slove function return empty solutions
Use dsolve for differential equations

3 years ago | 1

Answered
For loop variable error
m_for_k = [m1 m2]; vector. K_ex(i) = m_for_k * wn(i)^2; vector times scalar gives vector. Vector cannot be stored i...

3 years ago | 0

| accepted

Answered
I was plotting some data in loglog scale "Errors against step sizes" but my curve is not connected , and i can not fix it, what is the problem?
Some of your simp_err are exactly 0 but log plots cannot draw exact 0 (or negative) so the plot disconnects there. This happe...

3 years ago | 0

Answered
Array not compatible error
You are using diff() thinking that you are getting derivatives. However you are taking diff() of numeric matrices and diff() of ...

3 years ago | 0

Answered
Problems with Yticks, help?
Ticks are only drawn if they fit within the axes limits. The default axes limits are determined by rounding the range of data. Y...

3 years ago | 0

Answered
Error using fieldnames. Invalid argument of type 'cell'. Input must be a structure or a Java or COM object.
If you look near line 240 of https://github.com/netstim/leaddbs/blob/master/ea_normalize_ants.m you will see that the code assum...

3 years ago | 1

Answered
Sorting a sparse matrix according to matrix entries
[r, c, s] = find(spX); [s, idx] = sort(s); out = [r(idx), c(idx), s] You will not be able to get a sorted sparse matrix. You ...

3 years ago | 1

| accepted

Answered
read csv file with headers with readtable and get the header
You will not be able to do this with a single call to readtable() . Either process the lines separately or else use readcell()...

3 years ago | 0

| accepted

Answered
How to export "Nan" and "inf" in a table from MATLAB to EXCEL as text?
base = tempname; cname = base + ".csv"; xname = base + ".xlsx"; A = [1; 2; 3; nan; inf]; writematrix(A, cname) dbtype(c...

3 years ago | 0

| accepted

Answered
How to calculate the duty cycle of a time signal in a for loop?
load waveform wr = real(waveform); wi = imag(waveform); subplot(2,1,1); plot(wr); ylabel('real'); subplot(2,1,2); plot(wi); ...

3 years ago | 0

| accepted

Answered
I have distance matrix, and know 0,0 point, how to find out to what point each distance belongs to?
There is nothing inherent in the matrix that can tell you which row or column corresponds to which bin. You would have to have a...

3 years ago | 0

| accepted

Answered
Trouble changing the value of a member of a class in Matlab
Java objects and .NET objects and similar objects are not restricted by MATLAB's naming rules. MATLAB It looks like you are us...

3 years ago | 0

Answered
selecting indices in a matrix and setting the rest to zero
new_A = zeros(size(A), 'like', A); new_A(idx,:) = A(idx,:);

3 years ago | 0

Answered
Why do I get: Error using sum Invalid data type. First argument must be numeric or logical?
You generally have cell arrays that contain cell arrays. However, in some places some of the entries are not cell arrays and are...

3 years ago | 2

Answered
How to read .ard file created by ANSYS Fluent
Use readmatrix . You might need to use 'headerlines', 4 as an option, and possibly 'FileType', 'text'

3 years ago | 0

Load more