Answered
for loop over video data
Does this work as expected? [n_frames,n_rows,n_columns,n_color_channels] = size(data); block_size = 30; n_frames_to_process =...

3 years ago | 0

| accepted

Answered
I'm getting an error using fplot, How do I get it to work?
Xs = 1.8; fs = 10; fi = pi/3; t1 = -0.1; t2 = 0.2; t = [t1, t2]; x = @(t)Xs*sin(2*pi*fs*t+fi); fplot(x,t,'-')

3 years ago | 1

| accepted

Answered
How to display an image and a plot on the same figure while controlling axes
my_image = uint8(linspace(1,0,720)'*linspace(1,0,1280)*255); % some diagonal color gradient angles = linspace(0,4*pi,200); m...

3 years ago | 1

| accepted

Answered
Variable might be set by non scalar operator
m=('insert value'); should be m=input('insert value');

3 years ago | 0

Answered
Manipulate strings in a table- remove leading numbers if present
load S solution = regexprep(names,'^[\d\.]+\s+','')

3 years ago | 0

| accepted

Answered
Patch - controlling transition of transparency - how to?
To have all patches span the full transparency range, use normalized values, where each column of fit is normalized separately. ...

3 years ago | 0

| accepted

Answered
Why does the line plot depend on the generator type in a for loop ?
The i_subset passed in to make_line_plot.m is a column vector, and that is assigned to generator if mode == 1. Then generator is...

3 years ago | 1

| accepted

Answered
How can I set zero value to white? in mesh plot
Like Rik said, one option is to replace zeros with NaNs in A; then they won't show up at all (so by default you see the white ax...

3 years ago | 0

| accepted

Answered
How to list all situation of vector including fix number?
perms(1:10) https://www.mathworks.com/help/matlab/ref/perms.html

3 years ago | 0

| accepted

Answered
Find match between 2 tables of unequal length
new_table = B(ismember(B.Name,A.Name),:);

3 years ago | 0

| accepted

Answered
How can I add this condition on my code?
U = [10;20;30;40;5;60;40;80;20;100]; V = [2;3;4;5;6;7;8;9;10;1]; idx = find(diff([0;floor(cumsum(U/100))])) V(idx) sum(V(i...

3 years ago | 0

| accepted

Answered
Mask with a for loop
removeData([2 3 0 0 7 8 0]) function vec = removeData(vec) x = 1; while x < numel(vec) if vec(x) ~= 0 && vec(x + 1) ==...

3 years ago | 0

Answered
Unique concatenation of multi-dimensional cell arrays
A(:,:,1) = {[1;2;3],[],[3]; [],[],[4]; [],[2;3],[]}; A(:,:,2) = {[2;3;4],[4],[3]; [],[],[4]; [],[2;4],[]}; ...

3 years ago | 1

Answered
Monitoring a directory for new files does not catch all the files
new_files will contain the names of all the new files, so instead of using just new_files(end) and assuming there's one new file...

3 years ago | 0

| accepted

Answered
3D axes ticks get truncated when figure window is not maximized
Set the xticks manually (like you set the xlim manually): xticks(928:933) Maybe the yticks too: yticks(200:100:600)

3 years ago | 0

Answered
Extract each column in excel spreadsheet and create new workbook with header as spreadsheet name
C = readcell('CatchCount1.xlsx'); for ii = 2:size(C,2) C_new = C(:,[1 ii]); C_new{1,2} = 'Catch'; writecell(C_ne...

3 years ago | 0

| accepted

Answered
split array to subarray and save it as csv file
fn = 'your\csv\file.csv'; pn = 'folder\where\you\want\the\results\to\go'; n = 6; C = readcell(fn); for ii = 1:size(C,2)/n ...

3 years ago | 0

| accepted

Answered
load different data types from the same subfolder simultaneously
If there is one .mat and one .dat file in each folder, then this should work to get the names (full path names) of each .mat and...

3 years ago | 0

Answered
How to sum values from unique dates in MATLAB table?
% the original table timestamp = datetime({'20-Jan-2023 15:12:22';'20-Jan-2023 15:12:22';'17-Jan-2023 12:57:02';'17-Jan-2023 13...

3 years ago | 1

Answered
Using nested loop to enter individual values in a matrix
Basically, you don't need the second input(), after the inner while loop, at all. close all, clear all, clc; % Ask use...

3 years ago | 0

| accepted

Answered
"Continue" in "for loop" based on trial count
Maybe this: for k = 1 : numel(X_vector) for n = 1 : 5 x = X_vector(k); y = Y_vector(k); % Now u...

3 years ago | 0

| accepted

Answered
Plotting different color points based on array values
data = struct('Name_1',randperm(50)); DE = 2.5+5*rand(1,50); threshold = 5; [~,idx] = sort(data.Name_1); x = data.Name_1(i...

3 years ago | 1

Answered
EDF writing - error when using cell array as signal DATA
The edwrite documentation doesn't state this explicitly (that I can see), but apparently (according to this answer), if you spec...

3 years ago | 0

| accepted

Answered
an issue with datetime
Maybe you mean "HH" a = '02/15/2023 13:00:00'; b = datetime(a,'InputFormat','MM/dd/yyyy HH:mm:ss')

3 years ago | 1

| accepted

Answered
How to bring a patch to the bottom of a figure?
Option 1: Call fill before plot: figure() hold on c = fill([0 4 5 2 1],[0 0 2 4 3],'y'); a = plot([1 2 3],[1 2 3],'color','k...

3 years ago | 1

| accepted

Answered
Check if a field within a structure exist
for i=1:9 chunk = sprintf('Period_%d',i); if isfield(Data.(chunk),'Breaks') data = xyz; else...

3 years ago | 0

Answered
Compare two arrays of same length
Maybe something like this: gear = zeros(1,789); for i = 1:789 if FF_one(i) < FF_two(i) gear(i) = 1; elseif ...

3 years ago | 0

Answered
is this the proper way to convert your axis and graphs to square microns?
Seems ok, assuming that each zone is an annulus and that all zones are concentric.

3 years ago | 0

| accepted

Answered
How do I properly use the "while", "for", "loop" command in this problem?
Maybe something like this: % A = T(:,1); %Column vector A = [71.213; 74.499; 79.175; 54.163; 83.008; 52.615]; B = length(A...

3 years ago | 1

Answered
Obtain all table elements from a column which correspond to certain string in another column
% a table str = {'Onus';'Bonus';'Loan us';'On us';'Bonus';'Money';'Bonus'}; num = [1;2;3;2;4;3;1]; t = table(str,num) % get ...

3 years ago | 1

| accepted

Load more