Answered
How do I retrieve a specific range of values from a cell?
Let's say your cell is called data and this is a 1 by 4 cell array with each cell containing column vectors of size 685 x 1. You...

6 years ago | 0

| accepted

Answered
How to combine multiple .txt and calculate Mean, Std, Min, Max
Put all your txt files in a folder and you can then use the following myfolder='name of the folder' fils=dir([myfolder '\*.txt...

6 years ago | 1

| accepted

Answered
Index exceeds - for loop
The problem is you are specifying indices that dont exist in val. val is a column vector of 10201x1 values, i.e. 10201 rows and ...

6 years ago | 0

| accepted

Answered
Function returning multiple plots
Just use the hold on statement as follows: myfunction(input1); hold on; myfunction(input2); myfunction(input3); myfunction(i...

6 years ago | 0

Answered
Feature extraction surf, storing points
One way is to store as a struct, for example s(ii).features=features; %where ii would be incrementing as you iterate through ea...

6 years ago | 1

Answered
iterate through text files and read them as a matrix
You have to make sure your filename and path are correct. Try modifying your input to readmatrix as follows: A=readmatrix([myf...

6 years ago | 0

| accepted

Answered
Getting rid of a for loop
The following should do the job. ind=input(1:end-2)>input(2:end-1) & input(2:end-1)<input(3:end); ind=[false; ind; false]; % ...

6 years ago | 1

Answered
How to match two date columns
To find the rows in your table, called dsColShort, wherein run_date and trade_date are equal you can use the following code idx...

6 years ago | 0

| accepted

Answered
seperating vertical and horizontal images from an image seperately
I'm not sure what you mean by vertical / horizontal image but from your equation it looks like you want to find the absolute d...

6 years ago | 0

Answered
For loops and If statements not working correctly
First of all, when you use element-wise operators (.* .^ ./) like you have been trying you don't necessarily need to run the for...

6 years ago | 1

| accepted

Answered
Help with Loops and Switch cases and Mean
Hi Deriniece, You could modify your code as follows: Q=''; ii=1; while ~strcmpi(Q,'No') Q=input('Would you like to ente...

6 years ago | 1

Answered
New to matlab. Trying to code with excel.
[data,varnames]=xlsread('myfilename.xlsx') sumdata=sum(data); % sumation of columns T=array...

6 years ago | 0

Answered
Read & Plot to compare Data in Multiple SpreadSheets
Hi Raghnu, I reckon you should store your data in a structure and use dynamic fieldnames to have a fieldname corresponding to e...

6 years ago | 0

| accepted

Answered
How to add values from if statements to a column
You just have to make an index for every time your if statement is satisfied. See the modified code. function [x,y]=valuesof(da...

6 years ago | 1

| accepted

Answered
Collect double values of a matrix
Ok Following your comment I've edited my answer: I would first find rows which have equal X and Z values. c=1; for ii=1:size(...

6 years ago | 0

Answered
Select a point on the graph
You can do the following: [~,ind]=min(sqrt(member_value(:,1).^2+member_value(:,2).^2)); %find index for point closest to origin...

6 years ago | 0

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

6 years ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

6 years ago

Solved


Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

6 years ago

Solved


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

6 years ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

6 years ago

Solved


Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

6 years ago

Answered
Reading/Extracting data from a text file in a certain format using Matlab
No problem. On your first question; The last index of an array can be specified by calling the index end. end + 1 means we add ...

6 years ago | 1

Answered
Moving Plot Around Curve Point
Seems like just a syntax error. Modify the following line and see: plot3(x(pts(k)), y(pts(k)), z(pts(k)),'or', 'MarkerSize'...

6 years ago | 0

| accepted

Answered
Finding a Number in a random array
Have a look at the following documentation and scroll down to the part about indexing matrices with two subscripts. For your sec...

6 years ago | 0

Answered
Interpolation Values from a Surface map
HI Irfan, The interp2 function will solve this. See the following documentation. The function can be written as: Zq = interp2(...

6 years ago | 2

Answered
While loop in while loop; Shortening
You could try the following. J=5; while J<13 if J>=7 j=1:6; else j=1:J; end z=63*pi.*(J-...

6 years ago | 0

| accepted

Answered
finding the intersection for a trace to a threshold
I'm not sure which variable you use to represent your x data, but lets call it x, where x is the same size as nzstp and cutoff. ...

6 years ago | 1

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

6 years ago

Solved


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

6 years ago

Load more