Answered
Random number generator help
rand gives you number(s) between 0 and 1, so with appropriate scaling and offsetting, you can use it to get number(s) from any g...

4 years ago | 0

| accepted

Answered
Colormap- specific values for each heatmap value
Your idea of replicating the same color a certain number of times to build a colormap is good. However, the number of times each...

4 years ago | 0

| accepted

Answered
How to display data in textbox from a choosen name in listbox?
Something like this is what you're after: function listbox1_Callback(hObject, eventdata, handles) val = get(handles.listbox1...

4 years ago | 1

| accepted

Answered
legend for multiple plots
% some matrices: res540 = rand(6,15); res720 = 1+rand(6,15); res900 = 2+rand(6,15); res1080 = 3+rand(6,15); % store the l...

4 years ago | 0

| accepted

Answered
Readtable ignoring first X rows
You can specify 'NumHeaderLines',0 in your call to readtable: q_sectors = readtable('qualy_sectors.csv','NumHeaderLines',0) No...

4 years ago | 2

| accepted

Answered
reshape a cell array to be row major
Maybe storing the data in a table will end up being more convenient: t = readtable('log.txt') t(2,:) However, to get a cell a...

4 years ago | 0

| accepted

Answered
How to find the heights and widths of two repetitive neighboring peaks?
One place to start might be findpeaks, perhaps with the NPeaks and/or MinPeakHeight arguments, possibly with a low-pass filter a...

4 years ago | 0

Answered
How to get argument of complex exponential?
The "sampling time" is not small enough. It must be less than 1/(2*nu) - i.e., sampling rate greater than 2*nu - to avoid aliasi...

4 years ago | 0

| accepted

Answered
Error in pdm_experiment_eeg_only
MATLAB is case-sensitive, so try changing screen to Screen: framrate = Screen ('framerate',0);

4 years ago | 0

Answered
matrix columns in matlab
A = 1:1000 Y = repmat(A.',1,1000)

4 years ago | 0

Answered
How to change distance of xticks in 3d bar plot (using bar3) ?
july_mean = 20 + (50-20).*rand(24,1); june_mean = 20 + (50-20).*rand(24,1); may_mean = 20 + (50-20).*rand(24,1); dat = [may_m...

4 years ago | 0

| accepted

Answered
Cache values from loop (with differing lengths) to save in 1 variable / matrix
To handle vectors of different lengths, you can make time_to_event a cell array: time_to_event = cell(numel(files),1); for ii ...

4 years ago | 0

| accepted

Answered
How can I select the aerosol values from different size of matrix?
Note that A is [2 2] A = size([0 0; 1 1]) so size(A) is [1 2] size(A) So when you compare size(Out(dates).aerosol) with size...

4 years ago | 0

| accepted

Answered
Extraction of frequencies and there indices from FFT graph ( for DTMF Detection)
The second output from findpeaks is the location of the peaks, which are the indices in the input vector where the peaks occur. ...

4 years ago | 1

Answered
ismember(a, b) function problem
ismember(a,b) tells you whether each element of a exists somewhere in b ismember([1 2 3 4 5],[2 4 6]) % 2 and 4 exist in [2 4 6...

4 years ago | 0

| accepted

Answered
The setting of the time series on the x-axis
Instead of using datenum x values, you can plot with datetime x values and then set the xticklabel format using xtickformat: % ...

4 years ago | 0

Answered
error: invalid call to script
You are getting that error because you have a file called imadjust.m (located in /home/oo/), which is a script. Scripts take no ...

4 years ago | 1

Answered
Delete a selected row in a uitable
Move this line to the OpeningFcn: set(handles.uitable4,'CellSelectionCallBack',@(h,e) set(h,'UserData',e)); Having that line i...

4 years ago | 1

| accepted

Answered
I want to represent a set of 2-D experimental data (1 x 10matrix) using a colorbar plot.
data = [0 10 15 0 10 17 0 17 30 0]; x_spacing = 30; y = 18; n = numel(data); p = patch( ... 'XData',x_spacing*([0;1...

4 years ago | 0

| accepted

Answered
Can the Code Profiler be used programmatically to profile an app in App Designer?
"Can I initiate the start and stop of the profiling programatically?" Yes. See the "action" input argument part of the document...

4 years ago | 0

| accepted

Answered
Solo plotea en 2D. Error al utilizar surf o scatter3 en 3D
You can rename your script view.m to another name that doesn't shadow a built-in function, or you can change the View property o...

4 years ago | 0

Answered
Add image into figure outside of plot axes
If your axes limits are fixed, then you could make an image in the same axes, place it outside the axes limits and turn Clipping...

4 years ago | 0

| accepted

Answered
Find all rows that contain a specific value in a excel
This call to strcmp: strcmp(T.Product, 'String', item) has an extraneous 2nd argument 'String'. It should be: strcmp(T.Produc...

4 years ago | 0

| accepted

Answered
How to replace columns in a datafile after performing mathematical operations to them?
x=5; % a constant y=7; %another constant a = readmatrix('file1.txt'); disp(a) new_a = a; new_a(:,1) = new_a(:,1)/x; new_...

4 years ago | 0

| accepted

Answered
creating one legend for all data
c and d (the variables returned from boxplot) are matrices of handles to the lines created by boxplot. In legend, you can specif...

4 years ago | 1

Answered
how to extract pixels from a image {black and white only }
data = imbinarize(rgb2gray(imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/160786/image.jpeg'))); % 1....

4 years ago | 0

Answered
[Error: Function definition not supported in this context. Create functions in code file
To get past that particular error, move all the function definitions to the bottom of the script. I've done this for the m-file...

4 years ago | 2

| accepted

Answered
"Column Vector" XTick labels
plot(0:2,2-(0:2),'*') xticks([0 1 2]) xticklabels(sprintfc('%d\\newline%d',[0 2 1 1 2 0]))

4 years ago | 1

| accepted

Answered
How can I un-nest a cell array of different type cells?
C = {{'X';'X';'X'} [1;2;3] {'Y';'Y';'Y'} [1;2;3] {'Z';'Z';'Z'} [1;2;3]} % your cell array T = table(C{:}) % make a table T wri...

4 years ago | 1

| accepted

Load more