回答済み
How do you start a new column for every iteration in a loop?
If |data| is a 2-dimensional array then |percent_correct| is a scalar so you need to make sure it is saved in one exact place in...

8年弱 前 | 0

| 採用済み

回答済み
Convolution of matrix rows with while loop
Avoiding the |var1,var2|, etc. naming is good practice. In case you only need the last one, it would be fairly simple. This woul...

8年弱 前 | 0

回答済み
create a matrix from a matrix x=[-2 -1 0 1 2]; which follow quadratic equations
x = [-2:2]; y = [2:-1:0]; bsxfun(@power, x', y)

8年弱 前 | 0

| 採用済み

回答済み
How to break a number down into 4 squares
Such a breakdown (each output number should be at most the half of the previous one) does not always exist, take |23| for exampl...

8年弱 前 | 1

回答済み
Saving function variables without evil eval
How about having all these state variables in a struct in the first place? Then you can save them to a mat file, for example: ...

8年弱 前 | 0

回答済み
Plot will not work
|nums(1,2)| is one particular element in your |nums| array, hence |t| will be |1|, and you'll end up plotting a single point.

8年弱 前 | 0

| 採用済み

回答済み
How to creat a four dimentional (from a vector) matrix and reset it's 'lower triangle'
<https://uk.mathworks.com/help/matlab/ref/permute.html permute>

8年弱 前 | 0

回答済み
I am getting error with"Matrix dimensions must agree" for following code,please let me know where I am doing wrong?
The problem is here: k3/Qc Looks like |Qc| gets its value from global variable |u| which seems to be a non-scalar. So it...

8年弱 前 | 0

| 採用済み

回答済み
Hi, I wanted to get a quick look over for my program see if there were any flaws.. I think it's complete. specifications and program in link thanks..
The random sample comes from a normal instead of a uniform sample (assuming U stands for uniform). Also all the data you generat...

8年弱 前 | 0

| 採用済み

回答済み
Replacing small sections of a logical vector
There are a few different ways to do it. This method may be frowned upon, but it nonetheless produces the required output: ...

8年弱 前 | 0

回答済み
Plot based on bins with binary data
This would do the trick if you bin them from |0| to |max(stimDuration)|: n = 2; % number of bins bar(splitapply(@(x) sum...

8年弱 前 | 1

| 採用済み

回答済み
question on using parfor
The error message refers to the variable classification when using parfor: <https://uk.mathworks.com/help/distcomp/classificatio...

8年弱 前 | 1

| 採用済み

回答済み
Boolen logic operations between integer numbers
>> logical(3) ans = 1 >> logical(-4) ans = 1 So 1 && 1 = 1, according to the <https://uk.mat...

約8年 前 | 1

| 採用済み

回答済み
Finding sum of all the elements in a row corresponding to an element which is less than a certain value?
a = [1 0 3; 9 1 5; 6 0 9; 2 4 6; 5 2 0]; sum(sum( a(a(:,1)<3, 2:3) )) a(:,1)<3 created a binary vector to indicate which...

約8年 前 | 1

| 採用済み

回答済み
Cut differently odd and even rows in matrix
n = size(a, 2); % number of columns a(1:2:n,:) = a(1:2:n,[[3:n],[1:2]]); % move first 2 elements in odd rows to the end ...

約8年 前 | 0

| 採用済み

回答済み
How to convert a 3x3xN matrix to a N element cell array?
% a is your 3*3*N array c = mat2cell(a,3,3,ones(1,N)); c = c(:);

約8年 前 | 1

| 採用済み

回答済み
Problems running a function in a for loop and dynamically assigning to a struct
Thought I'd add an 'Answer' to make this question 'answered' instead of the comments. The loop fails eventually due to the HF...

約8年 前 | 1

| 採用済み

回答済み
Undefined function 'mtimes' for input arguments of type 'struct'.
This gave me a different error in the first loop: Undefined operator '+' for input arguments of type 'struct'. Which is ...

約8年 前 | 0

回答済み
How to access specific rows (or columns) of a file data without loading all data?
If you're using a .mat file and 'rows (or columns)' refer to an array stored in that file, then the doc helps: <https://uk.math...

約8年 前 | 0

回答済み
Generating a random symmetric matrix
A = randi(2,N,N) - 1; A = A - tril(A,-1) + triu(A,1)'; This will copy the upper triangle to the lower triangle.

約8年 前 | 4

| 採用済み

回答済み
How to combine the name of struct together
Data.(k)(i).somethingelse = your_value See the <http://uk.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-va...

約8年 前 | 1

| 採用済み

回答済み
Error using table (line 253)
Did you check how Mode looks like? It is a row array with 2 elements, which is not compatible with the 3-element column vectors ...

約8年 前 | 0

回答済み
Minimum in a matrix! and its location
There is no need to loop through the rows, you can specify the 'by-dimension' minimum like this: a = [ 1 2 3 0; 7 5 4 6; 9 ...

約8年 前 | 1

| 採用済み

回答済み
random vector containing zero and values
A(1:6)=0; N = 6; b = randi(N); C =(1:b); A_idx = randperm(N, b); % generate b random integers from 1 to N C_idx = randper...

約8年 前 | 1

回答済み
Convert contents of array into index
Your first code should work. l = ones(1, 10000); % make sure this is bigger than the largest index col will specify col ...

約8年 前 | 0

| 採用済み

回答済み
Subscript indices must either be real positive integers or logicals.
F= ... b3(X-x(1)) ... A '*' is missing: F= ... b3*(X-x(1))...

約8年 前 | 1

回答済み
Updating of new Matlab software
Same question <https://uk.mathworks.com/matlabcentral/answers/307321-can-i-uninstall-matlab-2016a-after-installing-matlab-2016b?...

約8年 前 | 0

回答済み
Inner matrix dimensions must agree
4*(0.985)*(5.67*10.^-8)*(TS).^3*(TT) Here according to the <https://uk.mathworks.com/help/matlab/matlab_prog/operator-prece...

約8年 前 | 0

回答済み
Filter table data by character string
November = data(11 == month(data.date),:)

約8年 前 | 0

| 採用済み

さらに読み込む