Réponse apportée
Go around matrices/vectors columns
Here's one way, which is generalized in that it will work for other polygons besides pentagon, but it assumes the vertices are g...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Help extracting data from 3D matrices
Here's one way: A = cat(3,[1 0; 0 0],[0 2; 0 0],[0 0; 3 0]); v = [2;3]; [m,n,l] = size(A); idx = sub2ind([m,n,l],repelem(1...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Code to check for open uifigures
This will find all the uifigures you have open and store them in the variable f. Then you can delete them or whatever you want. ...

plus de 2 ans il y a | 0

Réponse apportée
for loop keeps putting out error
You have defined a variable called size, which means that the next time the code tries to use the built-in size function (i.e., ...

plus de 2 ans il y a | 0

Réponse apportée
How to create tiledlayout grid in vertical order
Set up variables: n_rows = 3; n_cols = 2; n = n_rows*n_cols; data = (1:n)+zeros(10,1); Default tiledlayout order, for r...

plus de 2 ans il y a | 1

Réponse apportée
My calculation for respiratory rate shows the same bpm for my 3 waveforms.
You are calculating the average of the inverse of the differences of t, but t is essentially just a vector of all time indices: ...

plus de 2 ans il y a | 0

Réponse apportée
Detrending data changing matrix size
Do you mean this? DFRT.data(1:128,:) = detrend(DFRT.data(1:128,:));

plus de 2 ans il y a | 0

Réponse apportée
How to make all the .tif files with the same size?
min_sz = min(sz,[],1); for ii = 1:N files(ii).data = files(ii).data(1:min_sz(1),1:min_sz(2)); end

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Unable to perform assignment because the left and right sides have a different number of elements. Error in Assignment1Motorbike (line 139)
The culprit is this line: x_rd = vb * diff( sin(Q) ); Q is a scalar, so sin(Q) is a scalar, so diff(sin(Q)) is empty, so x_rd ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
resize matrix based on indices
input_file = 'logfile_example-30-09-23 .xlsx'; output_file = 'trials_2_5_7_10_only.xlsx'; ids = [2 5 7 10]; id_column = 3; ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
rename txt file within a specific folder
folder = dir('C:\...\...\...\*.txt'); % file_name = 'test.txt'; final_file_name = 'analysis.txt'; for id = 1 p = folder(...

plus de 2 ans il y a | 0

Réponse apportée
Matlab divides with the same value in every iteration
You are overwriting the variable y on each iteration of the loop. for i = 2:5 % ... y=x/(pi*D(i)^2./4); % ... e...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Remove missing entries from nested cell array
% make a cell array of string arrays with some missing elements: str = ["some",missing,"string"]; C = repmat({str},1,3) % rem...

plus de 2 ans il y a | 0

Réponse apportée
How Can I stored previous result with new or current result in same cell array?
Instead of initializing to empty the variables you plan to populate in the base workspace, try to get them from the base workspa...

plus de 2 ans il y a | 0

Réponse apportée
How to append text and numbers into a title
start_month_ISI=12; start_day=1; mth = month(datetime(1, start_month_ISI, 1), 'Name'); % To get the name of the month title({...

plus de 2 ans il y a | 1

Réponse apportée
Convert char to table
If you have a char vector like this, coordinates = '[446 154;445 155;444 156;443 156;442 156]'; disp(coordinates) then one wa...

plus de 2 ans il y a | 0

Réponse apportée
Too many output arguments error
writematrix doesn't return any outputs. Just say: writematrix(A, 'M.xls') What do you intend to be stored in B?

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to search for a index to a variable with known size
% some variables: a = rand(2,3,4); x = 4; simTimeData = zeros(226411,1); % size to look for: size_to_find = [226411,1]; ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
I want to collect data to cell array in Matlab App Designer.
Here is an app that collects data entered into two numeric editfields into matrix, and also performs some calculations and store...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
how do I find the x-axis value from my yline intercept on my acceleration curve
% some data: tout = (0:60).'; yout = 10*log(tout+1); y_val = 26.8224; % your plot: P1 = plot(tout,yout(:,1),'linewidt...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
why does it not plot the function?
Each iteration of the for loop, you are overwriting the value of R_P, so after the loop R_P is a scalar (i.e., it only has one e...

plus de 2 ans il y a | 1

Réponse apportée
fprintf formatting problem with cell and array matrix 3
You just have to tranpose data as well: data = [a; b].'; Full code: clear, clc, close all %% input data fracs = ... [1...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Error while evaluating UIControl Callback. Trying to get old code to work
The Callback of the C.Type popupmenu is defined as the following character vector: 'alc=get(C.panel(1),''Children''); for i=1:l...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
adding all fields of a structures
Here's one way to do that: % a structure like your "my_struct", but with only 3 fields: my_struct = struct( ... 'bin_1',a...

plus de 2 ans il y a | 1

Réponse apportée
Why does exportgraphics not fully work, when using yyaxis?
Why does exportgraphics not fully work, when using yyaxis? I don't know why, but plotyy (not recommended) seems to give the cor...

plus de 2 ans il y a | 1

Réponse apportée
Upper limit on the number of UIAxes children allowed
Consider updating the XData, YData, and ZData of an existing line, rather than creating a new line each time you want to add mor...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
vertical line on x axis
x = 3; y = interp1(a1,x1,x); line([x,x],[0,y])

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
horizontal boxplot with data dots on it and different colors
%% Learning rate clc; clear all; close all y1 = [1.06 1.1 0.89 0.96 0.95 1 0.76 1.41 0.97 0.75 0.83 0.76 0.79 1.31 1.08 0.83]'...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Convert two cell arrays (time values and data values) to one cell array of timeseries
AA = cellfun(@(dd,tt)timeseries(dd,tt),Y,t,'UniformOutput',false);

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How to generate three figures to fill the screen (distributed vertically)?
The Position of a figure does not take into account the height of the menu bar or tool bar inside the window (if any), nor the h...

plus de 2 ans il y a | 0

Charger plus