Risposto
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...

quasi 8 anni fa | 0

Risposto
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 ...

quasi 8 anni fa | 0

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 1

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

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

quasi 8 anni fa | 2

Risposto
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]...

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

Risposto
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),...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 1

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

quasi 8 anni fa | 1

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 1

Risposto
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);...

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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); ...

quasi 8 anni fa | 2

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 1

| accettato

Risposto
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,...

quasi 8 anni fa | 1

| accettato

Risposto
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. ...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 0

Risposto
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...

circa 8 anni fa | 1

| accettato

Carica altro