답변 있음
How to plot a tiled layout using a loop?
> should a nexttile be in the loop? Yes, but the tiled layout should be defined before the loop. The first two examples list...

5년 초과 전 | 4

답변 있음
Stop & pause a simulation in app designer using push button
There is no built-in method for pausing a process as of r2021a. Here's how I've achieved this behavior in apps. The main ide...

5년 초과 전 | 5

| 수락됨

답변 있음
Most efficient way of creating variables
It's good that you're following that advice. E = [V1(:,10), V2(:,10), . . ., Vn(:,10)]; % most efficient method of this list ...

5년 초과 전 | 0

| 수락됨

답변 있음
How to calculate the confidence interval from distributions overlap
It sounds like what you're looking for is to find the number of standard deviations between the mean of the orange distribution ...

5년 초과 전 | 0

| 수락됨

답변 있음
how to expand 2D array?
m = [1 2 3 4 5 6 7 8]; y = reshape([[m;nan(size(m))],nan(size(m,2))],2,[]) Version 2 after quest...

5년 초과 전 | 0

| 수락됨

답변 있음
filling gaps in time data series with NaN
Compare the original vector of datetime value with the interpolated vector using ismember. This will create a logical vector id...

5년 초과 전 | 0

답변 있음
Return to GUI after Running Data
There's a line in the GUI code or within one of the callback functions that is closing the GUI figure or making it invisible. Lo...

5년 초과 전 | 1

| 수락됨

답변 있음
Extract x,y,z coordinates from figure
Depending on how you plotted the 3D surface, you may already have those coordinates before the plot is produced. For example, ...

5년 초과 전 | 0

답변 있음
How do I use an if statement to check if a data is present on a excel sheet?
At the top of the documentation page for xlsread there is warning that xlsread is not recommended and it suggests alternative fu...

5년 초과 전 | 0

답변 있음
Breaking and spliting vector into groups and averaging
timevec = [0 2 3 4 5 0 9 3 4]; chunk = [0 0 0 1 1 1 1 0 0]; g = cumsum([1, diff(chunk)]~=0); % assuming 'chunk' is a row vec...

5년 초과 전 | 2

| 수락됨

답변 있음
App designer - display multiple ROI on the same image
I assume "doesn't like this syntax" means that the crosshairs and circle are appearing on a different figure. The reason that...

5년 초과 전 | 1

| 수락됨

답변 있음
App Designer - help with syntax for referring to an array's indices
The question is mostly clear and the image is helpful. Interesting approach to align the buttons with the UITable rows - I like...

5년 초과 전 | 1

| 수락됨

답변 있음
Use findpeaks on specific frequency range
Limit the range of the peak-search by limiting the inputs. I can't see the x-ticks in your image but this example ignores any...

5년 초과 전 | 0

| 수락됨

답변 있음
How do we store the results of a loop vertically?
> Is this a correct way to store the values of a loop vertically in an excel file? CompiledResults(:,i) = Output Well, no. T...

5년 초과 전 | 0

| 수락됨

답변 있음
How to merge two timetables with different data and time?
> [T1;T2] is not working and retrns the following error: All tables in the bracketed expression must have the same number of row...

5년 초과 전 | 0

| 수락됨

답변 있음
How to have a stack plot with different colors?
To change the axis background color, https://www.mathworks.com/matlabcentral/answers/486181-is-it-possible-to-change-stackedp...

5년 초과 전 | 1

| 수락됨

답변 있음
Convert timetable into matrix where time is a variable
A = [minutes(TT.Time), TT.Var1];

5년 초과 전 | 1

| 수락됨

답변 있음
How to find standard deviation and mean for this monte-carlo simulation
You either need to store the values within the loop or you can get rid of the loop and use vectorization. N = 100; x = rand...

5년 초과 전 | 0

답변 있음
3D bar axis label
set(gca,'ytick',1:4,'yticklabel',compose('Pack %d',1:4))

5년 초과 전 | 0

| 수락됨

답변 있음
Getting an error that says a variable is not defined in my code, but i have defined it in my function file
Functions have their own workspace (exception:nested functions). Variables are not shared between workspaces unless you explici...

5년 초과 전 | 0

| 수락됨

답변 있음
Change color on a single bar
You have to set FaceColor to 'flat'. https://www.mathworks.com/matlabcentral/answers/553894-barcharts-colours-based-on-other-ve...

5년 초과 전 | 2

| 수락됨

답변 있음
Find the first and last 1 in each column
X = [NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 0 0 0 0 0 0 0 0 0 0 ...

5년 초과 전 | 0

답변 있음
Shift columns of a matrix with different values
Method 1: indexing with rem This method shifts values rightward in each row of the nxm matrix A by the amounts specified in vec...

5년 초과 전 | 1

| 수락됨

답변 있음
intersection area of 3 or more rectangles
This approach is inspired by the even-odd rule for determining if a point is inside a polygon. If the max left-edge value is sm...

5년 초과 전 | 0

| 수락됨

답변 있음
overtop IMAGESC text and change colorbar colors in white for some value of the text
The 0.0% values are rounded to 1dp so any values between -0.049 and 0.049 will show 0.0%. So, you need to find the indices of f...

5년 초과 전 | 1

답변 있음
subplot aligment automatic method
Method 1: equate axis sizes for all axes after adding colorbar Size of axes without a colorbar will be set to the size of axes ...

5년 초과 전 | 1

| 수락됨

답변 있음
Can I create a drop down menu in App Designer in which the drop down items reference a cell array?
The handle to the dropdown menu must be available in the same workspace that updates the cell array. If that's done in AppDesig...

5년 초과 전 | 0

| 수락됨

답변 있음
how to define a gradient colormap
You need to define the colorscale using caxis. caxis([-1,1]) to apply to all axes, arrayfun(@(h)caxis(h,[.2,.6]),ax) % ax i...

5년 초과 전 | 0

답변 있음
Date formats 'uuuu' vs 'yyyy', 'mm' vs 'MM'
The confusion is warranted and due to inconsistencies in Matlab's date-time formats. datetime format uses MM/mm for months/min...

5년 초과 전 | 2

| 수락됨

답변 있음
Plot Cook’s distance for mixed effects model
plotDiagnostics is a public method of the LinearModel class. The function is defined in LinearModel.m and recieves a LinearMod...

5년 초과 전 | 1

더 보기