Answered
How to ask the user to check avalue from a loop
I'm not entirely sure I understand what you are trying to do, but if you just want to get basic input from the user then see the...

8 years ago | 0

Answered
How can I split a column?
Maybe I'm misunderstanding, but can't you just index it out: col1=data(:,1:8) col2=data(:,9:16)

8 years ago | 0

| accepted

Answered
For a value 0<i<=4 give k=1, 4<i<=8 give k=2 and so on
for i=1:100 k=floor((i-1)/4)+1 end

8 years ago | 0

| accepted

Answered
How to multiply just certain elements of a column in a matrix by a factor?
testMat=ones(20,3) testMat(5:10,3)=testMat(5:10,3).*0

8 years ago | 1

| accepted

Answered
how do i do a for loop to find different array sizes
mode would have to be a cell array since the number of columns of each array is not the same i.e mode{1} = [1 2 3]; mode...

8 years ago | 0

| accepted

Answered
How to remove Y value for given X
data=[1 0.4;2,0.6;3,0.2;4,0.6;5 0.9] index=data(:,1)==4; data(index,2)=NaN Something like this?

8 years ago | 0

| accepted

Answered
How to tell MATLAB to go to the next replication i
if WHATEVER=false break; end

8 years ago | 0

Answered
How can I save matrices created in a for loop in the workspace?
I'm not entirely certain I'm fully getting the gist of your question but, save(filename) will save all workspace var...

8 years ago | 0

Answered
Generate a table of conversions from degrees (first column) to radians (second column). Degrees should go from 0⁰ to 360⁰ in steps of 10⁰. Recall that π radians = 180⁰
%Create Table conversionTable=table() %Add degrees column conversionTable.Degrees=(0:10:360)' %Add radians column ...

8 years ago | 1

Answered
setting format in workspace view
It probably occurs when the number becomes too large or too small to be represented by the long fixed decimal format. It will al...

8 years ago | 1

Answered
Find neighboring nodes in a list of node positions
Something like this: x = randn(10,1); y = randn(10,1); %set desired distance maxDistance=1.6; ...

8 years ago | 1

Answered
How can I remove an entire row of zeros in a matrix?
a=[45 23 54;0 0 0;9 3 32]; zero=a==0; ind=all(zero,2); a(ind,:)=[] Presumably the entire row has to have ...

8 years ago | 1

| accepted

Answered
char to binary converting
bin2dec(string) will convert your string to a decimal equivalent. The underlying representation of the decimal number will be bi...

8 years ago | 0

Answered
Compare segments of a vector
ind=repmat(logical([0 0 0 0 0 1 1 1 1 1]),1,100) b=a(ind) a(ind)=[] c=a>b

8 years ago | 0

Solved


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

8 years ago

Solved


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

8 years ago

Answered
Averaging rows with same name
Generally vectorized code will run faster than equivalent solutions with loops. Though, personally I don't find it all that intu...

8 years ago | 0

Answered
Creating Identity Vectors Using FOR Loop
Or if you really wanted to make them all totally separate... A = zeros(1,4); B = zeros(1,4); C = zero...

8 years ago | 0

| accepted

Solved


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

8 years ago

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

8 years ago

Answered
Reshape matrix in the desired form
B=[reshape(A(:,:,1)',1,16);reshape(A(:,:,2)',1,16)]

8 years ago | 0

| accepted

Answered
how to delete columns from matrix
a(:,all(a>=20))

8 years ago | 0

| accepted

Answered
My code works except variable s remains fixed to 20 when it should be changing depending on the values of input for variable x
The value of x will have been changed by your first decision structure, so by the time you test it again in the second decision ...

8 years ago | 1

| accepted

Answered
How to create a Looped Colum Matrix?
a=linspace(0,1,1440) a=repmat(a,365,1)

8 years ago | 0

Answered
Finding Statistics of a Matrix Help!!!
You could reshape the matrix into a vector, then apply the functions to the vector

8 years ago | 0

Answered
Limiting Precision on MATLAB
Could try forceSum=int32(T-W)

8 years ago | 1

| accepted

Answered
AF1 contains values calculated by a formula in an angle range of [-90 90]. But I am getting index exceeds matrix dimensions error in f=pks(1) line. Trying this for 8 days but not getting.
At a guess, the findpeaks function is returning nothing so when you try to index into it, it produces an error. Presumably you'v...

8 years ago | 0

| accepted

Answered
Nested For Loops help
You're not retaining the variable 'diff' but just keep replacing it with the latest subtraction. You could initialize diff=[] be...

8 years ago | 0

| accepted

Solved


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

8 years ago

Solved


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

8 years ago

Load more