Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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 ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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 ...

environ 8 ans il y a | 0

Réponse apportée
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...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

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

environ 8 ans il y a | 2

Réponse apportée
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]...

environ 8 ans il y a | 1

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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),...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 1

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

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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 ...

environ 8 ans il y a | 0

Réponse apportée
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...

environ 8 ans il y a | 1

Réponse apportée
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);...

environ 8 ans il y a | 1

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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); ...

environ 8 ans il y a | 2

| A accepté

Réponse apportée
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 ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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,...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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. ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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...

environ 8 ans il y a | 1

Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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...

environ 8 ans il y a | 1

| A accepté

Charger plus