Réponse apportée
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 ...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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<...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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)

plus de 8 ans il y a | 0

Réponse apportée
How can I remove the ranges from a specific column vector?
del=[1:4 9:12 13:16] k(del)=[]

plus de 8 ans il y a | 1

Réponse apportée
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'...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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)

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
Setting all the entry in multiple columns to zero
A(:,3:5)=0

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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 ...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
How can I make a vector of a repeating sequence
repmat([0 0 0 1],1,40)

plus de 8 ans il y a | 6

Réponse apportée
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

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
choose samples in for loop
You could use a step in your for statement i.e. for k=1:10:length(X)

plus de 8 ans il y a | 0

Réponse apportée
choose elements from a array with condition
extract=rowMatrix(10:10:1000)

plus de 8 ans il y a | 0

Réponse apportée
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); ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

Charger plus