Answered
password field is not taking input
The following threads may have workarounds that work for you: https://www.mathworks.com/matlabcentral/answers/1456459-can-t-ent...

3 years ago | 0

Answered
Extracting Specific Rows From xlsx or txt File
Here's one way. This method reads the file's contents into a cell array using readcell. The data on lines 14:3:end of the file e...

3 years ago | 0

Answered
Why won't my plot work? (not elementwise issue)
The T values are around 2000 to 3500 but the ylim was set to [0 4]. I changed the ylim to [0 4000]. format compact clear all ...

3 years ago | 1

| accepted

Answered
Read data with repeat counts
str = fileread('file.txt') C = regexp(regexp(str,'\s+','split'),'\*','split'); idx = cellfun(@isscalar,C); C(idx) = cellfun(@...

3 years ago | 0

| accepted

Answered
identify a factor that links two equal matrices but positioned in different places on the same plane
load RC_matlab load RC_trasl % calculate the centroid of each set of points: c_matlab = mean(RC_matlab,1); c_trasl = mean(...

3 years ago | 0

| accepted

Answered
xticklabel in the midle of the spectrogram
Something like this maybe: % some plot plot(rand(1,1000)); % some file names: name = {'a wav file.wav','another wav file.w...

3 years ago | 0

Answered
creating smaller matrix from a large matrix
M = randi(10,16,16); % 16-by-16 matrix of integers between 1 and 10 disp(M); siz = [4 4]; % size of smaller matrices to di...

3 years ago | 0

| accepted

Answered
Simple Vector Indexing Question
M = rand(6000,5); rows = [ 540 1238 1423 2144 2403 3280 3485 4385 4573 5152]; idx = arrayfun(@c...

3 years ago | 0

Answered
how to get value for each loop?
% ... Y = 5; N = 6; repeat = 5; i = 0; % a vector to store the total scores: total_scores = []; while repeat == Y...

3 years ago | 0

| accepted

Answered
Remove datetime values from a table
"I want to remove all dates from file2.Var3 that does not exist in file1.Var3" I assume you mean to remove the rows from the ta...

3 years ago | 1

| accepted

Answered
extract a row of 2D array based on constant 2D array values
A = [90 10 21; 90 20 21; 90 30 21; 90 40 22; 90 50 21; 88 10 20; 88 20 20; 88 30 24; 88 40 22; 88 50 21; 86 10 20; 86 20 21; 86 ...

3 years ago | 1

| accepted

Answered
export a uitable with backgound color
"Warning: UI components will not be included in the output. To include UI components, use the 'exportapp' function." Did you tr...

3 years ago | 0

Answered
Why does the context menu not appear when right-clicking a node in a checked box tree?
uitreenodes each can have their own uicontextmenus, so you need to associate the context menu with the nodes rather than with th...

3 years ago | 0

| accepted

Answered
Access values in cell array in each loop.
load array_TT_cell for iter = [1 2] fB = cellfun(@(x)x.fB(iter),array_TT); disp(sprintf('Iteration %d:\...

3 years ago | 0

| accepted

Answered
How to reproduce axis labeling for given bar3 plot
Something like this: log4=[0.769651681808561,0.00850658785134913,0.00264356326264210,-0.00202871267443307,-0.00288250568612709,...

3 years ago | 0

| accepted

Answered
Reshape 3D matrix with different wanted 2D matrix rows to a 2D matrix of the same row height
Something like this? A = cat(3,[1 2 3;4 5 6;7 8 9;0 0 0],[10 11 12;0 0 0;0 0 0;0 0 0],[13 14 15;16 17 18;0 0 0;0 0 0]); B = ...

3 years ago | 0

Answered
semilog x in boundedline doesn't work
The problem is the 0 in your x vector. Non-positive numbers cannot be represented on log scale. (Specifically, log(0) is negativ...

3 years ago | 0

| accepted

Answered
interpolation of coordinates in space using interp3
interp3 is for interpolating a function of 3 variables, i.e., if you had a function f(X,Y,Z) that returns a value for each (X,Y,...

3 years ago | 1

| accepted

Answered
resize and fill the matrix
Try this. It looks for stimulus data (a contiguous section with 2's in column 2), and takes 60 rows before the start and 40 rows...

3 years ago | 0

| accepted

Answered
Add numbers to the matrix
Here's one way: stim_column = 2; trial_column = 3; prestim_value = 1; stim_value = 2; poststim_value = 3; input_file = '...

3 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (10)
Avoid naming your variable var, since that is the name of a function you are trying to use. Also, a cell array doesn't appear to...

3 years ago | 1

| accepted

Answered
small numbers in the legend
The default text interpreter, tex, is interpreting the underscores as subscripts, so you can either: (1) escape the underscores...

3 years ago | 1

| accepted

Answered
Timer not working in my programmatic app (not app designer)
First, line 25: %update_timer = data.update_timer; needs to be uncommented for that error to happen (otherwise you get a diffe...

3 years ago | 0

| accepted

Answered
Help in plotting a graph
% some data: f = linspace(0.03,0.09,100); % row vector (1xn) x = [-1/0.06*(f-0.06)-12; 25*exp(-40*(f-0.03))-10; 1-(f-0.09)/0.0...

3 years ago | 0

| accepted

Answered
Transparent shapes are not transparent to each other
Using the 'painters' Renderer fixes the problem: fg = figure(1); clf; fg.Renderer = 'painters'; set(fg,'Units','centimete...

3 years ago | 2

| accepted

Answered
Plotting of colormap for single value in x axis and multiple values in y axis
Something like this? The only change is to set xlim(t([1 end])), i.e., let the x-limits span the entire t vector. t = 0:10; y ...

3 years ago | 0

| accepted

Answered
create the complete outline of a pie chart characterized by values ​​<1%
Here's one way (adding a separate call to line to create the circular outline): MMM = [1, 0.33]; labels = MMM(:,1); percentag...

3 years ago | 0

| accepted

Answered
Create an array with only the increasing values of a pressure time series.
This? load DATA plot(a) idx = diff(a) <= 0; while any(idx) a([false; idx]) = []; idx = diff(a) <= 0; end plot(a)...

3 years ago | 0

Answered
Using cumulative areas as an error threshold
You can use cumsum to perform the cumulative sum over all dr at once. Then loop over sections of that cumulative sum, finding th...

3 years ago | 0

| accepted

Answered
Changing color in matlab
im = imread('xyz_converted.png'); im(:,:,[1 2]) = im(:,:,[2 1]); % swap the Red and Green channels imshow(im)

3 years ago | 0

| accepted

Load more