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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 1

| akzeptiert

Mehr laden