답변 있음
How to set "dbstop if error" only to stop in my code
I don't think that that is possible. Are you aware of the "function stack" capability in the user interface? I show a screensho...

3달 전 | 0

| 수락됨

답변 있음
Repeated Measures ANOVA Matlab
If you have the Statistics and Machine Learning Toolbox, you can use the anovan function. In particular it looks like this examp...

3달 전 | 0

답변 있음
How do I calculate percentage or frequency and display it on a bar plot?
Because you have the typo rate=(frequency/total):100; instead of rate=(frequency/total)*100;

3달 전 | 0

답변 있음
Symbols instead of line with plot
It looks like it might be because k_ is only a single value, the last one of the loop. Maybe you wanted k_(i) = k; in the lo...

3달 전 | 0

답변 있음
According to the documentation, there is no two-output syntax for the readmatrix command. You'll need to get a deeper understand...

3달 전 | 0

| 수락됨

답변 있음
How to process multiple Excel files using the same Matlab code for each
If you can make a cell array of the filenames, eg. filenames = {'this file.csv','that file.csv','oh this file too.csv'} then y...

3달 전 | 0

| 수락됨

답변 있음
Index exceed number of array elements(1)
In your function, the input is a character array, but you convert it to a string. The expression Testdate(7:10) would have pul...

3달 전 | 0

| 수락됨

답변 있음
How can I set the y tick interval (to powers of 10) on a log scale?
Like this? N = 500; x = sort(1e3*rand(N,1)); y = sort(1e6*rand(N,1)); figure loglog(x,y) set(gca,'XLim',[1e1 1e4],'XTick...

3달 전 | 0

| 수락됨

답변 있음
Is it possible to set the size of the gap between grouped bars in a bar graph?
Another option would be to abandon using grouped bars in a single call to bar(), and instead plot the two sets of bars with two ...

3달 전 | 0

| 수락됨

답변 있음
Is it possible to set the size of the gap between grouped bars in a bar graph?
This question and the answer from MATLAB staff suggest that it is not possible using the built-in bar function. However, there ...

3달 전 | 0

답변 있음
How to plot a line over a specific interval?
Can you upload the data? Specifically, it is unclear to me what sort of data type g is. Instead of plotting x, you'll want to d...

3달 전 | 0

| 수락됨

답변 있음
create a variable and specify its column
The specifics will depend on what format the variable day is. Here, I assume it is a datetime. % Create the table day = dateti...

3달 전 | 1

| 수락됨

답변 있음
sort boxplot based on 25-75th percentiles
Yes, it is possible. The algorithm would be something like Find the percentiles on the data, using the prctile command, before ...

3달 전 | 0

| 수락됨

답변 있음
Index in position 1 exceeds array bounds (must not exceed 26)
You haven't provided enough info to run your code, which would make debugging much easier. You also didn't tell us which line gi...

3달 전 | 0

답변 있음
trying to use logical matrix to get remove some elements from matrix instead of getting a same matrix im getting a column matrix
Assuming you want zeros in the other locations: a=[1,2,3;12,21,2;2,1,2] b=(a>1) c = zeros(size(a)); c(b)=a(b) c = ...

3달 전 | 1

답변 있음
How to check what part of an array isn't scalar?
Just to clarify, are you saying that you have a categorical array, you are trying to apply the unique command to that array, and...

3달 전 | 0

답변 있음
My output did not display in command windows when using script
The syntax you used, fprintf(fid,...) is explicitly for writing to files. Use fprintf(...) % without "fid" argument to write...

3달 전 | 1

답변 있음
(Array indices must be positive integers or logical values.) any help plz
The specific reason you get that error is that sx is complex number. sx is complex because s is complex. s is complex because ...

3달 전 | 1

| 수락됨

답변 있음
How to change the plot title and file name when saving it to a for loop
Part of the problem is that you are mixing character arrays and strings. The following works (after you set your own outputdir):...

3달 전 | 1

| 수락됨

답변 있음
For loop to calculate distance between a 5d dimensional data point and another matrix
The distance from the i-th point of T to the j-th centroid is sqrt(sum((T(:,i) - centroids(:,j)).^2)); % Check my formula here,...

3달 전 | 0

답변 있음
I have a variable with a string that I would like to use as a filename, how do I input that string into a function rather than the variable name?
I think I see the problem. Did you notice that the output of the inputdlg command is a cell array? You need the contents of that...

3달 전 | 0

| 수락됨

답변 있음
array and logicals; deleting columns
Here is one way. arr = [1 2 3; 4 5 6; 7 8 9]; logic = [false true false]; new = arr(:,not(logic))

3달 전 | 0

| 수락됨

답변 있음
Indexing problem. I want to insert a vector into another vector with a loop.
Here is one way. A = [5 4 3]; B = [1 -1 -1 1 0 0 0 0 0 0 0 0 0 0]; for nb = 0:numel(B)-4 output = [A circshift(B,nb)...

3달 전 | 0

답변 있음
how to specify y axis?
Try this: clear clc clf x=1:1:24 yyaxis right y =[0,0,0,0,0,2.879097736,22.91004173,45.42868867,58.31916249,64,65,66,65,6...

3달 전 | 0

| 수락됨

답변 있음
how to specify y axis?
set(gca,'YTick',[0 500 1000],'YTickLabel',[0 500 1000])

3달 전 | 1

답변 있음
Error Using fprintf Invalid file identifier. Use fopen to generate a valid file identifier.
Is this good enough? I = rand(2); if ~isnan(I) I if abs(I)>2 fprintf("Violated Bell Inequality"); end else f...

3달 전 | 0

| 수락됨

답변 있음
Using a Variable between different functions
You can pass them out of the first function: function [coin, I, evAlice, evBob] = CHSH_(sigma_x,sigma_z) and into the second o...

3달 전 | 0

| 수락됨

답변 있음
I have a variable with a string that I would like to use as a filename, how do I input that string into a function rather than the variable name?
I don't have dxf_open, but the following -- which is effectively the same as what you posted -- works for me: answer = 'test'; ...

3달 전 | 0

답변 있음
joining one column from a table to another while matching all other columns
(Your code won't produce the tables a and b.) I believe the outerjoin command does what you want: a = table({'k','l','m','b','...

3달 전 | 0

| 수락됨

답변 있음
Difference between rng('shuffle') and NO rng for estimating with MLE
If you start a fresh instance of MATLAB, and generate a sequence of pseudorandom numbers, it will always be the same sequence. (...

3달 전 | 1

| 수락됨