답변 있음
Define condition for both imaginary and real parts of numbers
x = pi + i if real(x)~=0 && imag(x)~=0 disp("YES") end

4년 초과 전 | 0

| 수락됨

답변 있음
Row and column of numbers in matrix
[rowNum, colNum] = find(matrix == value) Or, if you're working with floating point decimals, [~, minIdx] = min(abs(matrix - v...

4년 초과 전 | 0

| 수락됨

답변 있음
How to get the confidence interval for bootstrap?
Why are you sorting s in s=sort(s)? There's no need to manually eliminate the NaN values and there's no need to use a loop. ...

4년 초과 전 | 0

| 수락됨

답변 있음
How can I skip the first to lines from a text file and proceed to read the file with header lines in between the values?
You could use readtable and then eliminate the columns and rows associated with the header lines. T = readtable('https://www.m...

4년 초과 전 | 0

답변 있음
How to make a bar graph out of the first and second column of a matrix?
sleeprxn2= [ 0 0.6229 1.0000 0.3404 1.0000 0.2744 ] [groups, gro...

4년 초과 전 | 1

| 수락됨

답변 있음
How do I rotate the view of a cylinder created using surf plot?
Use makehgtform to translate and rotate the object. [X,Y,Z]=cylinder([0 3],1000); M=makehgtform('translate',___,'xrotate',___,...

4년 초과 전 | 1

답변 있음
I want to obtain the values of streamlines and put it into legend.
Your contour lines are all black so a legend of black lines would not be helpful to map the contour values to the plot. I recomm...

4년 초과 전 | 0

답변 있음
Will polyfit work with datetime vectors
I'm also looking for a solution to this and specifically am interested in the y-intercept of a simple linear fit so I can plot t...

4년 초과 전 | 0

답변 있음
remove the zeros in the Matrix
Here's how to remove rows or columns that contain only 0s data = [0 0 0 0; 0 4 5 2; 0 2 5 4; 0 2 4 1] rowsAll0 = all(data==0...

4년 초과 전 | 0

| 수락됨

답변 있음
Adjust legend position outside the figure layout
Since you're using tiledLayout the best option is to specify the layout as shows in this example. lh =legend(__); lh.Layout.Ti...

4년 초과 전 | 0

답변 있음
Is there a better way to initialize the DataTipTemplate field in primitive objects?
I've had this problem with patch objects in the past and I solved it by doing something similar to what you suggested, making a ...

4년 초과 전 | 2

| 수락됨

답변 있음
Divide date ticks into hours
Use xtickformat | ytickformat | ztickformat which sets the TickLabelFormat of the axes (Matlab R2016b or later) datetick(t...

4년 초과 전 | 0

| 수락됨

답변 있음
How do I round this datetime to the nearest 0.1 second?
dt = datetime(' 01-Oct-2020 04:49:10.350','Format', 'dd-MMM-uuuu HH:mm:ss.SSS') dtRound = dateshift(dt,'start','minute') + seco...

4년 초과 전 | 1

| 수락됨

답변 있음
Do not plot the shape in the middle and polar transformation
This demo uses a cleaned up version of your code and then does the following, Computes center of noisy circle Shifts noisy ci...

4년 초과 전 | 0

| 수락됨

답변 있음
Finding the full width half maximum (FWHM) of a rounded part of peak instead of sharp peaks
This uses rmoutliers to remove the spike and then computes the FWHM of the resultant curve. You can play around with rmoutliers ...

4년 초과 전 | 1

| 수락됨

답변 있음
ttest and confidence interval
I assume you're intentionally avoiding the std() function. However, your calculation of standard deviation is incorrect. s=sq...

4년 초과 전 | 1

답변 있음
Difference between two statements
Good question. See this discussion and if you have any other questions or comments, let's continue the disucssion.

4년 초과 전 | 1

| 수락됨

답변 있음
the function should find the min value in each row, when I run the code it doesnt print the correct answer. Anyone know whats wrong?
The function returns "A" which is the entire matrix. If you want it to return the minimum value, it should return "min". Howev...

4년 초과 전 | 0

답변 있음
How to keep menu open when selecting option
I have also found this default beahvior frustrating but I do not know a way to keep the menu open after making a selection. I s...

4년 초과 전 | 1

| 수락됨

답변 있음
How can I create another window from menubar in appdesigner ?
I suggest calling an input dialog window from the menu item's callback function. See inputdlg.

4년 초과 전 | 0

| 수락됨

답변 있음
Name Contour levels outside plot
The following demo produces a contourf plot extracts the coordinates of the contour lines determines which lines intersect w...

4년 초과 전 | 1

답변 있음
Removing "head" entry from doubly linked list
To achieve a circular list where the first and last nodes are circularly connected, follow these 2 steps. Step 1: Modify the c...

4년 초과 전 | 1

답변 있음
How I can use K-fold cross validation for training selection sequentially not randomly?
I suggest identifying each group with a grouping variable. groupID is the grouping variable. % Set these values n = 540; ...

4년 초과 전 | 0

| 수락됨

답변 있음
How to highlight a point?
There are 3 steps to this process. Get the current point of the cursor Find the closest point to the cursor when the cursor i...

4년 초과 전 | 2

답변 있음
Is it possible to only allow brush to select data from certain lines in a plot?
Set HandleVisibility to off (or callback) for the graphics objects you'd like to hide from the brush tool. Note that this will...

4년 초과 전 | 1

| 수락됨

답변 있음
Trying to create a table with a char array as variable names
This demo creates the table you described using random text. histcounts is used to count the number of each letter. The counts...

4년 초과 전 | 0

답변 있음
how do you define a matrix and its variable
Learn about preallocation. Options: i = 4; j = 3; M = nan(i,j) M = ones(i,j) M = zeros(i,j)

4년 초과 전 | 0

답변 있음
how do i create a concentric black and white circles on a color image with different brightness
This uses the gray colormap. n = 20; % number of circles r = [1,10]; % [smallest, largest] radius center = [0,0]; % cen...

4년 초과 전 | 0

답변 있음
How do I start a function at the exact computer clock time?
> How do I start a function at the exact computer clock time? It depends on how you define "exact" and "start". If "start" m...

4년 초과 전 | 0

| 수락됨

답변 있음
I have to select mode from matrix with sliding window of 3X3. How to do that?
n*m sliding mode; slides by intervals of 1 This computes the sliding mode within a 2D window that slides by 1 unit horizontally...

4년 초과 전 | 1

| 수락됨

더 보기