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

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 1

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

más de 2 años hace | 0

Respondida
Detrending data changing matrix size
Do you mean this? DFRT.data(1:128,:) = detrend(DFRT.data(1:128,:));

más de 2 años hace | 0

Respondida
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

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 1

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

más de 2 años hace | 0

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

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

más de 2 años hace | 1

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

más de 2 años hace | 0

| aceptada

Respondida
vertical line on x axis
x = 3; y = interp1(a1,x1,x); line([x,x],[0,y])

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

Cargar más