Answered
xlswrite to specific cells
As Adam has suggested xlswrite(filenametest, a, 'Sheet1', 'A1') xlswrite(filenametest, b, 'Sheet1', 'C3') xlswrite(fi...

9 years ago | 0

Answered
how to filter a signal ?
Please care for posting valid code. No parentheses around the argument of |for| and "legth" is assumed to be "length" and "s" to...

9 years ago | 0

Answered
ccode atan2 generates nan
There is no imaginary value for doubles in C. Then sqrt(-1.0) cannot be resolved with anything but NaN. You are asking for at...

9 years ago | 0

Answered
Help to find errors of if loop?
Do you know the debugger? You can set a break point in the first line and step through the code line by line. This will reveal d...

9 years ago | 0

| accepted

Answered
How can i use interval with decimal at the end of a count in for loop. e.g. t=1:1:18.7
Get the number of integers in the vector Pd: sum(mod(Pd, 1) == 0) After all these comments and questions for clarificati...

9 years ago | 0

Answered
sorting cell array ascending
If this is time critical, try: str = {'RUN_1';'RUN_10';'RUN_13';'RUN_12';'RUN_11'} ; [~, order] = sort(sscanf(sprintf('%...

9 years ago | 1

Answered
ODE Solvers fail to converge as the tolerances are decreased.
Your code is hard to read, but is looks like some of the parameters are interpolated linearly. Then the function be be integrate...

9 years ago | 0

Answered
i want to code the following such that the negative values get saved in zerocoeff and then the negative values becomes zero . I have tried something but i m still getting an empty zerocoeff .
What is the intention of "v(i5)=v(i5)"? Do you need a loop? v = w + alpha .* w; lt0 = (v < 0); zerocoeff =...

9 years ago | 0

| accepted

Answered
Count sequence of zeros with For loop
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength>: a = [3 0 7 8 0 0 1 5; ... ...

9 years ago | 0

Answered
Loop to extract rows from matrix
Don't do this. The topic is discussed daily in this forum, see e.g. <https://www.mathworks.com/matlabcentral/answers/304528-tuto...

9 years ago | 2

| accepted

Answered
textscan overwriting files by accident
I think that the problem occurs somewhere else, but not in the shown code. Why do you open the file in text mode? [EDITED: Th...

9 years ago | 0

Answered
Finding a hidden function
Most likely this callback is defined inside the FIG file. Open in in GUIDE and check the callbacks there.

9 years ago | 0

Answered
How to solve Conversion to cell from double is not possible.
You do not need a vector class or a cell array. The problem can be solved with numerical arrays directly: uAve = zeros(nR...

9 years ago | 0

Answered
How can I get my code to speak with a voice
With <http://www.mathworks.com/matlabcentral/fileexchange/18091-text-to-speech?focused=5096318&tab=function FEX: tts> you can do...

9 years ago | 0

Answered
Use linspace without scalar input?
x = 0.01; y = [1.01, 3.01]; n = 10; dxy = [linspace(x, y(1), n); ... linspace(x, y(2), n)]; Or: ...

9 years ago | 0

Answered
License checkout failed using the SURF algorithm
You do *not* need multiple licenses to run a code multiple times. The error message is clear in this point: Maximum number o...

9 years ago | 1

Answered
Define new tracking box
This seems to be a job for <https://www.mathworks.com/help/images/ref/imfindcircles.html>

9 years ago | 0

Answered
how to remove spikes from the signal.
Start with defining mathematically, what a spike is in your case. Does it differ by more than 3 standard deviations from the nei...

9 years ago | 0

Answered
hi, can anyone tell me what is the error of ode45(error per step) ,
You can trust |ode45| to reply the correct numerical results, as long as you provide correct inputs. The integrators require dif...

9 years ago | 0

| accepted

Answered
convert datetime format to numeric format
V = datevec(YourMatrix); V = V(:, 1:4); Depending on what exactly your input is, this might need some modifications.

9 years ago | 1

| accepted

Answered
Why should I stay?
Dear Daniel, I appreciate that you have decided to stay in this forum and spend a lot of time to answer questions. I'm still ...

9 years ago | 5

Answered
converting a matlab array (MAT-file) to C++ array
It would be easier to save the data as binary file: data = rand(8, 10); fid = fopen('File.data', 'w'); if fid == - 1...

9 years ago | 1

Answered
How can showing gif image during matlab processing
Does it work in the Java level: <http://undocumentedmatlab.com/blog/displaying-animated-gifs> ?

9 years ago | 0

Answered
How i convert a normal image into underexposure and over exposure in matlab ????
Do you have a mathematical definition for under- and over-exposure? This would be a good point to start from. The pixel value...

9 years ago | 1

| accepted

Answered
What does the hist3 command do to its inputs? Can anyone explain it in detail taking the following example:
Sorry for mentioning the obvious: Did you read the documentation already? <https://www.mathworks.com/help/stats/hist3.html do...

9 years ago | 1

Answered
multiply random elements of matrix
Create a matrix, which contains the product of *all* elements with another element: A = [25; 12; 13; 19; 23]; AA = A * ...

9 years ago | 1

Answered
How to plot vertical lines?
If the axes is scaled, e.g. when adding new objects or for printing, using the current limits for the Y-position is fragile. You...

9 years ago | 1

Answered
how to scale the array type double of range [-1,1] to [0,1] and [0,360] to[0,1]
The general method to scale any input array (vector, matrix, multi-dim array) to the range [0, 1] is: maxV = max(V(:)); ...

9 years ago | 3

Answered
Grouping Figures separately into windows and tabs
You can create a window, which contains several docked figures: desktop = com.mathworks.mde.desk.MLDesktop.getInstance; ...

9 years ago | 12

Answered
Why is my plot not showing a line?
Omit the loop: t = 0:0.1:0.8;; FC = IC * exp(R*t / (2*L)) .* cos(sqrt(1 / (L * C) - (R / (2*L)) ^ 2 * t)); plot(t, F...

9 years ago | 0

Load more