回答済み
How to replace all elements that are not even integers?
A different way of doing it - generate a list of random integers much larger than the number you need, and pick out the subset ...

約8年 前 | 0

回答済み
i want someone t explain it to me
kk iterates over the columns of the matrix There are two columns in the matrix so there will be two iterations of the loop. On t...

約8年 前 | 1

| 採用済み

回答済み
How do I find the first x value when y crosses a threshold and remains above the threshold for 5 consecutive data points
test=[1 2 3 4 3 4 5 6 4 3 3 4 5 10 8 6 4 4 7 6 8 9 10 4 4] threshold=4; index=test>threshold; startAt=regexp(char...

約8年 前 | 0

回答済み
How does the for-cycle check its conditions?
From the docs: _Avoid assigning a value to the index variable within the loop statements. The for statement overrides any change...

約8年 前 | 1

| 採用済み

回答済み
Setting bounds on a calculated array
It's easy enough to index the places where the values in the vector are greater than 127 or less than 1 indices=charVector<...

約8年 前 | 0

回答済み
Distribution of binary values
test=[1 1 1 0 0 1 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1] out=regexp(char(test+48),'[0]+|[1]+','match') s...

約8年 前 | 0

回答済み
Comment out the rest of the code
I suppose you could put in a double %% at line 100 to create a new section, and then just use the run section option on the prev...

約8年 前 | 0

回答済み
how to concatenate numbers from multiple cells into a single number?
You could store it as a char string a=[1 0 0 0 0 1 1 0 1 0] b=char(a+48)

約8年 前 | 0

回答済み
How can I remove the ranges from a specific column vector?
del=[1:4 9:12 13:16] k(del)=[]

約8年 前 | 1

回答済み
can anyone help me to solve this problem?i want xor operation of 2 character arrays how to do xor operation of 2 character arrays?
a=['a' 'b' 'c'] b=['d' 'e' 'f'] c=bitxor(int32(a),int32(b)) If you expressly want the result as a char array you'...

約8年 前 | 0

| 採用済み

回答済み
concatenating vectors generated with loop
Not really more compact, but it does away with the loop N=10 output=reshape([ones(1,N); 1:N],1,2*N)

約8年 前 | 1

回答済み
we have created one sparse matrix ,after that there is need to use one formula at the end,we got an error like undefined variable or function maximum but in the formula it s given like that ,plz help with this
Seems like you're calculating the maximum and minimum values with max(p4) and min(p4), but are not assigning them to the variabl...

約8年 前 | 0

回答済み
choose n elements from array and increase sequentially
dummyMatrix=randi(50,1,100) result=zeros(1,91) for iter=1:91 %extract 10 element window extract=dummyM...

約8年 前 | 0

回答済み
Index exceeds array bound help
On the last iteration of the loop z=91; you try to index z+1 (92) of array zz (which does not exist). On the last iteration of t...

約8年 前 | 1

回答済み
Setting all the entry in multiple columns to zero
A(:,3:5)=0

約8年 前 | 0

| 採用済み

回答済み
I keep getting the error "Index exceeds array bounds". I've looked all over to no avail, please help.
At a guess, you initialize sounds with: %Sounds sound(1)={'bark'}; sound(2)={'meow'}; sound(3)={'neigh'}; sound...

約8年 前 | 1

| 採用済み

回答済み
Compare two vectors and assigning values then adding to a empty vector
result=hue2<hue1 Will return a logical vector with a 1 wherever hue2<hue1 and a 0 otherwise. If you want this as a double r...

約8年 前 | 0

回答済み
How to generate all combinations of a vector
Generally, perms gives the permutations of a vector eg. >> perms([1 2 3]) ans = 3 2 1 3 ...

約8年 前 | 0

回答済み
How can I create a new column in a table via if function?
By way of a smaller example - %Create dummy table for the purpose of example tbl=table() tbl.KW=(1:10)' %Copy...

約8年 前 | 1

| 採用済み

回答済み
How can I make a vector of a repeating sequence
repmat([0 0 0 1],1,40)

約8年 前 | 6

回答済み
Can someone please help me with a loop issue.
E_=0:0.02:0.2 Values are indexed as E_(1), E_(2) and so on

約8年 前 | 0

回答済み
Concatenate an unknown amount of strings to a master string.
The first thing you are doing in your while loop is setting the finalString to [] - so you lose everything you concatenate toget...

約8年 前 | 1

| 採用済み

回答済み
What can I do to display all the guesses that the user guessed at the end?
A=randi([1,N]); %Chooses random number between 1 and N %Create while loop for guesssing G=0; guesses=[] whil...

約8年 前 | 0

回答済み
choose samples in for loop
You could use a step in your for statement i.e. for k=1:10:length(X)

約8年 前 | 0

回答済み
choose elements from a array with condition
extract=rowMatrix(10:10:1000)

約8年 前 | 0

回答済み
How to select one of the array and change the array data selected with another value ?
datasample=[83 84 82 81 82 86 81 85 87 88]; datasample(datasample==88) = mean(datasample); ...

約8年 前 | 1

| 採用済み

回答済み
storing loop function output in vector
y=Diff>=0 will return a logical array of all elements in Diff that are greater than or equal to 0. You can either just us...

約8年 前 | 0

| 採用済み

回答済み
How to display averages in new array?
B=[100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100.0000 100...

約8年 前 | 1

回答済み
Trying to do repeat math on multiple variables...
Fs = 44100; W_t = [0,150;150,600;600,1700;1700,7000;7000,22050]; W_r = W_t.*(2*pi/Fs) Is that what you want...

約8年 前 | 0

さらに読み込む