답변 있음
find probability of number in a matrix
You can sum all elements in each column that matches, and divide by the number of nonzero elements: v = (1:4)'; % your numb...

대략 8년 전 | 0

| 수락됨

답변 있음
store value after multiple loops
Storing results in a multidimensional array: results = zeros(T, T, T, T); % your code below for n1=1:T x=xi(n1); ...

대략 8년 전 | 0

답변 있음
How do I change a whole row/column to zero in a matrix relating to a 'greater than' condition.
> But is there an easier, more automatic way where I could say if a value in U is greater than 5 then change the corresponding c...

대략 8년 전 | 0

답변 있음
how to request for matlap 2015b version?
When you log in to your account and go to the Download Installer page, under Downloads, you should be able to see these two choi...

대략 8년 전 | 0

| 수락됨

답변 있음
sum even and odd places values
len = length(A); B = sum(A(mod(1:len, 2)==0)); C = sum(A(mod(1:len, 2)==1));

대략 8년 전 | 0

답변 있음
Index exceeds matrix dimensions.
Did you check what you get for f? f21=@(x)(exp(-x/3))/(4-cos(pi*x)); This returns a scalar, so f will be of size 1*1. If...

대략 8년 전 | 2

| 수락됨

답변 있음
Get columns from a matrix
m; % this is your 432x90 matrix N = 15; % number of small matrices res(N).small_matrix = []; % init empty nonscalar stru...

대략 8년 전 | 0

| 수락됨

답변 있음
how to get the specific member data from a struct array?
What c is is what is called a <https://uk.mathworks.com/help/matlab/matlab_prog/access-multiple-elements-of-a-nonscalar-struct-a...

대략 8년 전 | 0

답변 있음
I am trying to plot velocity vectors but they are not getting displayed in a single graph.How can I do that?
hold on % your code here hold off Where 'hold on' will 'Retain current plot when adding new plots' according to the <...

대략 8년 전 | 0

답변 있음
While loop going one too far
Seems like the same problem as <https://uk.mathworks.com/matlabcentral/answers/310334-why-does-this-code-which-is-written-to-cal...

대략 8년 전 | 1

| 수락됨

답변 있음
Why does this code, which is written to calculate sin(0) to sin(pi), also calculate sin(1.1*pi) even though the while loop should forbid it?
Is there a specific reason why you want to use a while loop? This would be much easier/quicker/easier to read is you vectorise ...

대략 8년 전 | 0

답변 있음
how to get number that occurs maximum number of times in an array of numbers?
Same question <https://uk.mathworks.com/matlabcentral/answers/63009-maximum-occurrence-of-a-number?s_tid=answers_rc1-2_p2 here>....

대략 8년 전 | 1

답변 있음
Getting a function error "Output argument "z" (and maybe others) not assigned during call"
If y<0, variable z doesn't get any value assigned to it. See the same question <https://uk.mathworks.com/matlabcentral/answer...

대략 8년 전 | 0

| 수락됨

답변 있음
How to insert elements in a heap
BinMinHeap(n)=ElementsToInsert(n) does not work because of <http://uk.mathworks.com/help/matlab/matlab_prog/access-multiple...

대략 8년 전 | 1

답변 있음
Syntax for solving linear equations
<https://uk.mathworks.com/help/matlab/ref/linsolve.html>

대략 8년 전 | 0

답변 있음
unexpected parenthesis. please i need urgent solution to this
Are you trying to plot plist against ref(count) and ref(count+1)? If that is the case, this would do that: plot(plist,ref(f...

대략 8년 전 | 0

답변 있음
I need load data .mat from file to my workspace. I used this code: filename = uigetfile({'*.mat'}, 'Select mat file'); but it´s non-functional. I need load data .mat to workspace and save to value with name x1. Is here somebody who know help? T
If you know your file will be named data.mat, you don't need uigetfile, simply <https://uk.mathworks.com/help/matlab/ref/load.ht...

대략 8년 전 | 0

답변 있음
How can I sort a cell array according to one column's order?
There may be a conflict in what you define to be of 'descending order': "if a matrix (in the first column) has the highest ra...

대략 8년 전 | 2

답변 있음
Hi! I need help with a loop!
There is no loop, because k only gets value of t-t/2=t/2 and none of the preceding ones. Changing that to k=1:t would give you t...

대략 8년 전 | 0

답변 있음
Sorting one matrix with another matrix
[A_sorted, idx]=sort(A,1) A_sorted = 2 1 4 3 idx = 1 2 2 1 B(bsxfun(@...

대략 8년 전 | 0

답변 있음
How to show a column of a cell array
Say your cell array is A. A(:,4)=num2cell(cumsum(cell2mat(A(:,3)))) (Cells to numeric, do the math, numeric back to cells...

대략 8년 전 | 0

| 수락됨

답변 있음
Changing matrix into order pairs
This gives what you described as [[1 2];[1 3];[2 1];[5 6];[1 7];[6 7]]: A=[1 2;1 3; 2 1;5 6;1 7;6 7]; B = mat2cell(A, ones...

대략 8년 전 | 0

답변 있음
Error: Undefined operator '-' for input arguments of type 'cell'.
If you want to preserve the shape of your cell array neural_cue_onset_time, you can convert the cells to the underlying data typ...

대략 8년 전 | 1

답변 있음
Removing duplicate edges?
A graph-driven workaround could be: d = digraph(Gene1,Gene2); m = full(adjacency(d)); g = graph(m|m',d.Nodes); Thi...

대략 8년 전 | 2

답변 있음
How do I add date and time to my exel filename
This produces an 'ugly' filename but it gets through the datetime->char conversion: filename = strcat('Solution_',datestr(d...

대략 8년 전 | 0

답변 있음
Capturing outputs from Loops
To keep track of error1/2 and times, you can maintain an array for each of them: error1 = zeros(91,1); error2 = zeros(91...

대략 8년 전 | 1

| 수락됨

답변 있음
How do I write a function called mystaff that takes one matrix input argument S, S is a n-by-m matrix from an excel file I have saved. Also the function doesn't return anything
function mystaff(S) end This takes S as input argument and doesn't return anything.

대략 8년 전 | 0

| 수락됨

답변 있음
Removing duplicate edges?
Seems like <http://uk.mathworks.com/matlabcentral/answers/84370-efficient-way-to-identify-duplicate-edges?s_tid=answers_rc1-1_p1...

대략 8년 전 | 0

답변 있음
Converting a time field in a table to a usable format
You can ultimately use the <https://uk.mathworks.com/help/finance/hour.html hour> function to get the hour from the date data. ...

대략 8년 전 | 0

답변 있음
Copying rows from one table to another
strcmp(table.Name, 'Smith') would do the trick.

대략 8년 전 | 2

| 수락됨

더 보기