Respondida
I have spectrometer data (X axis Wavelength, Y axis Intensity), I want to convert this data in to bit string to generate a key in 1s and 0s, is there any tool available in MATLAB to do this?
You should replace |for i = 0:1:3648| by |for i = 1:numel(IR)|. You could also use arrayfun to generate this without a for lo...

alrededor de 8 años hace | 0

Respondida
The floating point error exists in both linspace and array creation if the increment is not an integer value. Intersect and ismember fails.
This is probably due to the floating point accuracy. Multiplying so you expect only integers, rounding and then performing this ...

alrededor de 8 años hace | 0

| aceptada

Respondida
Finding highest position of values in two arrays?
Update: the code below incorporates what you describe and results in the required |C|. A=[0.1 3;0.3 1;0.6 2];B=[0.7 2; 0.8 ...

alrededor de 8 años hace | 0

Respondida
Set default value textedit
In your |OpeningFcn|, you need to set a value for the |numseg| field. That way, the field exists in your handles struct and that...

alrededor de 8 años hace | 1

| aceptada

Respondida
Use only defined 4D array elements
The code below should work for you. Since R2016b you can use the line with implicit expansion. N=3;Z=4;L=6; varcov=resha...

alrededor de 8 años hace | 0

| aceptada

Respondida
Making STOP - Button
I use a |uicontrol| |togglebutton| in such cases: %in your looping code: if get(handles.togglebutton,'Value') bre...

alrededor de 8 años hace | 2

Respondida
Count the appearances of each value per bin within a vector of 144 bins.
So you want to split your original vector into 144 vectors, and then get the |histcounts| of each vector? data=randi([-3 2]...

alrededor de 8 años hace | 1

Respondida
Unzipping using system command ? I couldn't understand the command
The |cellfun| function is used to apply a function each element of your cell array. By providing two cell arrays, the function i...

alrededor de 8 años hace | 0

| aceptada

Respondida
I want to cite Matlab 2017a image processing tool box and computer vision tool box in reserch paper. Please share the bibtex file.
I don't think you need to cite the individual toolboxes. The bibtex below is what I use when citing Matlab. The version can easi...

alrededor de 8 años hace | 0

Respondida
I need to store values from a for loop with a non-integer index in matrices. The matrices I have now have random 0's in the output.
You should treat meta-data as data. You can either keep your 'fractional index' as a separate vector (as you have done already),...

alrededor de 8 años hace | 0

| aceptada

Respondida
How do I find no. of instances of each value till it changes?
You can use the <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength |runlength|> function that Jan made. An...

alrededor de 8 años hace | 1

Respondida
downloading data with webread
You can use <https://www.mathworks.com/help/matlab/ref/gunzip.html |gunzip|>: url = 'http://example.com/example.txt.gz'; ...

alrededor de 8 años hace | 1

| aceptada

Respondida
App/GUI tutorials
Using GUIDE held me back for a long time, so below you'll find my advice on what to do when not using GUIDE. For distribution, i...

alrededor de 8 años hace | 0

| aceptada

Respondida
Why can't MEX find a supported compiler in MATLAB R2016a after I upgraded to Xcode 9.4.1?
Because Xcode 9 is not explicitly mentioned in the <https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sy...

alrededor de 8 años hace | 0

| aceptada

Respondida
How can I pull a 3x3 matrix from a larger one inside a for loop?
I would advise against using |i| as a loop variable, especially if you're using complex numbers. This is the grouping you're ...

alrededor de 8 años hace | 0

Respondida
how to open an csv file using xlsread
If you want to read a csv file, there is a function that is designed to do that: <https://www.mathworks.com/help/releases/R2018a...

alrededor de 8 años hace | 1

Respondida
sum every 2 pages at a time in 3D matrix
The code below isn't the most efficient for your example, but will work in more complicated situations. data = ones(3,2,5);...

alrededor de 8 años hace | 1

Respondida
Help with using SURF to analyze an image?
What your goal is, is not really clear to me, but you can use the code below to view an image as a surf. I used an example image...

alrededor de 8 años hace | 0

| aceptada

Respondida
Help plotting with simple linespace and surf?
You were very close: you only forgot to change |x| to |X| and |y| to |Y| after you added |meshgrid|. x=linspace(0,2*pi); ...

alrededor de 8 años hace | 2

| aceptada

Respondida
How can I find the location of the first negative value in a column?
Like this? a=[1;2;-3;4;-5;6]; [r,c]=find(a<0,1); a(r,c) (if you plan on using matrices as well: note that what is ...

alrededor de 8 años hace | 0

| aceptada

Respondida
How to color cell in a csv file?
A csv file is just a file with text characters. It generally contains numeric values that are separated by commas, hence the nam...

alrededor de 8 años hace | 0

| aceptada

Respondida
Shift Data to the Right and the Left
Since your vector is a column vector, shifting left or right (e.g. with |circshift|) will result in the exact same vector, while...

alrededor de 8 años hace | 0

| aceptada

Respondida
Matrix indexing of a 3D matrix, one by one each 3D layer?
Logicals are 8 times smaller than doubles, so memory concerns shouldn't be an issue. If you can work with a big |J|, you can eas...

alrededor de 8 años hace | 0

| aceptada

Respondida
How can we pass gpuArray in Cdata of imshow?
Because |image| is not holding your hand (and |imshow| is), you need to do the work yourself. In this case that means you need t...

alrededor de 8 años hace | 1

| aceptada

Respondida
How to group a collection of values in a vector?
There are a myriad of way to do this, one of them should be the code below. data=1:12;%example data data=reshape(data,4,...

alrededor de 8 años hace | 1

| aceptada

Respondida
WindowButtonDownFcn tries to access a callback function that no longer exists
Apparently the line of code is still there. Either it is saved in a .fig file, or you didn't actually delete/comment the line. ...

alrededor de 8 años hace | 0

| aceptada

Respondida
open a text file using fopen in read mode
As you can tell from the documentation for <https://www.mathworks.com/help/releases/R2018a/matlab/ref/fopen.html |fopen|>, the o...

alrededor de 8 años hace | 0

Respondida
mldivide does not support sparse inputs for code generation
You can try making a copy of this function, and editing it, so you avoid the |sparse| function, as that is causing the problem h...

alrededor de 8 años hace | 1

Respondida
When I use the "kmeans" function, I get a message "License Manager Error -4".
Apparently there is a limited number of users for the Statics Toolbox under your license. The only option is to wait until anoth...

alrededor de 8 años hace | 0

Respondida
Generating all possible pairs of polynomial?
The big problem is that you are throwing out most of your array. The method I use below does that as well, but much less so, mak...

alrededor de 8 años hace | 1

| aceptada

Cargar más