Respondida
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 =...

más de 3 años hace | 0

| aceptada

Respondida
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,'-')

más de 3 años hace | 1

| aceptada

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

más de 3 años hace | 1

| aceptada

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

más de 3 años hace | 0

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 1

| aceptada

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

Respondida
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) ==...

más de 3 años hace | 0

Respondida
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],[]}; ...

más de 3 años hace | 1

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

más de 3 años hace | 0

| aceptada

Respondida
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)

más de 3 años hace | 0

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

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

más de 3 años hace | 1

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

más de 3 años hace | 0

| aceptada

Respondida
"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...

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 1

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

más de 3 años hace | 0

| aceptada

Respondida
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')

más de 3 años hace | 1

| aceptada

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

más de 3 años hace | 1

| aceptada

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

más de 3 años hace | 0

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

más de 3 años hace | 0

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 1

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

más de 3 años hace | 1

| aceptada

Cargar más