Answered
If: No signal Then: number = "0"
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX:RunLength>: [B, N] = RunLength(Signal); ...

8 years ago | 1

Answered
How to remove white lines when surf edgecolor is set to 'none' and figure is exported as a .pdf file using export_fig?
In this forum you find many questions concerning these white lines on PDF. Under some of them you find my answer, that this is n...

8 years ago | 3

| accepted

Answered
Struct contents reference from a non-struct array object.
You want the output of |dir|, not the one of |sprintf|: file_temp = sprintf('%s\\*.bmp', folder); filearray = dir(file_t...

8 years ago | 0

| accepted

Answered
How to calculate angle of deviation between 2 images ?
This is a job for <https://www.mathworks.com/help/images/ref/imregister.html imregister>.

8 years ago | 0

Answered
How to make a matrix based on other values in a matrix that 'match'
Let's call the matrices A, B, C. B = [ 1 100 120 ; 2 200 240 ; 3 300 360 ; 4 400 480 ]; % Remove the sign at first: ...

8 years ago | 0

Answered
How can I concatenate a table of single binary digits into n-bit values?
If you want a char matrix: C = '01'; r1 = C(randi([1 2], 2, 10)) Now r1 contains e.g. '01' as columns. It is easy to...

8 years ago | 0

Answered
Can't solve ODE with array instead of constant
Do not solve an integration for a large set of parameters at once, because this reduces the processing speed and accuracy of the...

8 years ago | 0

Answered
How to store a intermediate variable from ode45 function to the Workspace as a vector
Remember that the ODE45 integrator has a stepsize controller, which can reject steps, if they are outside the error tolerance. T...

8 years ago | 0

| accepted

Answered
Matlab startup error, when Matlab 2018a is opened.
This seems to be a question concerning a 3rd party software. Then please mention this instead of letting the readers guess, whic...

8 years ago | 0

| accepted

Answered
Installing a file from fileexchange
You can put it in directory you want to. Maybe an extra directory for all "FileExchange" submissions is possible, or a specific ...

8 years ago | 0

Answered
Random Sampling of Repeated Numbers in an Array
B = unique(Q); while i < length(Q) [row col] = find(Q == B(i)); i = i + 1; end This cannot work, because |B...

8 years ago | 1

Answered
PNG vs. FIG File format - saveas function query
the format of the .PNG file is quite different It depends on what you save in the PNG, or in other word, if you save a scree...

8 years ago | 0

| accepted

Answered
Nested While Loops Not Updating?
Avoid to use the names of the important functions "sum" and "help" as variables, because otherwise these functions cannot be use...

8 years ago | 1

| accepted

Answered
I was trying the handel.m audio example for some testing, and now it is the ONLY sound I can listen to! PLEASE HELP!
If you run: [y, Fs] = audioread('president-is-moron.wav'); sound(y, Fs); and hear "Handel", this wave file contains t...

8 years ago | 0

| accepted

Answered
How to save text files with the exactly same name, in the same folder?
The code is strange. Using the message replies by |fileattrib| is a slow and indirect way to count the number of files in a fold...

8 years ago | 0

Answered
How to open a file and search for a specific parameter for it then change it and save and close?
It is a very bad idea to modify a source code 400 times to modify a parameter. What about using a loop to modify the parameter i...

8 years ago | 0

| accepted

Answered
Error while evaluating UIControl Callback..
I cannot find out, which is the line 1132. It is not useful to post such a huge code (without a proper formatting! Please read <...

8 years ago | 0

| accepted

Answered
mxCreateSharedDataCopy no longer supported in R2018a
[More a comment than an answer:] mxCreateSharedDataCopy was not documented. There might be an undocumented method in the 2018...

8 years ago | 1

Answered
How to get specific axes handle in GUI with more then one axes?
If the figure was created by GUIDE: handles_GUI1 = guidata(HandleToGUI_1); handles_GUI1.TagForMySpecificAxes % May be ...

8 years ago | 0

| accepted

Answered
Logical indexing a 2D array into a 2D array
Easier and faster without a loop: Z = [56,0,0,0,0,55; 0,0,0,0,0,0; 27,0,0,0,0,0; 0,0,0,0,0,0; ...

8 years ago | 4

| accepted

Answered
How do I find the path of an external hard drive plugged into my device with MatLab?
The answer depends on the used operating system. Under Windows you can check the existence of a file by changing the drive lette...

8 years ago | 0

Answered
How can I put in an array the elements near the center?
# Decide for a method to define exactly, which is the "center" in a matrix with an even side length. # Create a |for| loop from...

8 years ago | 0

Answered
Adding the first row of a matrix to every row
A = rand(3, 4); A(2:3, :) = A(2:3, :) + A(1, :); % Auto-expand since R2016b For older versions: A(2:3, :)...

8 years ago | 0

Answered
Undefined function snapshot for input arguments of type 'uint8'?
Did you read the documentation already? <https://www.mathworks.com/help/supportpkg/usbwebcams/ug/snapshot.html doc snapshot>. Yo...

8 years ago | 0

| accepted

Answered
How doe you calculte the precentage of al your data above a certain value?
100 * sum(PRx > 0.2) / numel(PRx)

8 years ago | 0

Answered
How to replace values with nan when there is a condition?
I want NaN in accuracyC if: its counterpart in RTc is nan but not when the value in accuracyC is 0. index ...

8 years ago | 0

| accepted

Answered
How to control the volume of speaker using MATLAB?
If you want to control the volume of the speakers use <https://www.mathworks.com/matlabcentral/fileexchange/25584-soundvolume-se...

8 years ago | 1

Answered
How to delete partial sub-string
C = {'JAK2';'JAKKVAR2KL';'JAKAKR8DW';'JAKK4';'JAK19';'JAKNUI87YU';'JAK0'}; D = strrep(C, 'JAK', '') |strtok| splits the ...

8 years ago | 1

| accepted

Answered
MATLAB 2015 and later problem with figure management
2nd answer after your (very good! +1 for this.) comment containing code to reproduce the problem: function createGUIDEGener...

8 years ago | 1

| accepted

Answered
could anyone help me to overcome the error for the following code
iwant1 = 8.3038e+08 iwant1 = 5.6314e+08 ... This overwrites the value of |iwant1| repeatedly. This is not meaningful,...

8 years ago | 0

Load more