Solved


Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

6 years ago

Solved


Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

6 years ago

Solved


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

6 years ago

Solved


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

6 years ago

Answered
Average values after every n coloumns
I think something like this would be a pretty straightforward way to do what you want: [N_loc,N_obs] = size(C); N_obs_avg = 29...

6 years ago | 1

| accepted

Answered
consider preallocating for speed
This warning means that when you are calculating a vector or matrix element-by-element in a loop, MATLAB performs faster if the ...

6 years ago | 1

| accepted

Answered
Loading and processing multiple images using uigetfile
Looks like you almost had it, but just to fill in the "%not quite sure what to put here" part: [file,path] = uigetfile('*.TIF',...

6 years ago | 0

| accepted

Answered
Using recursive method for finding the determinant of a matrix
It looks like what you have in mind could be implemented like this: function det = myDet(A) if isequal(size(A),[2 2]) det...

6 years ago | 1

| accepted

Answered
n as the natural numbers
You might try something like this (if n is a scalar): if n > 0 && floor(n) == n % n is a natural number else % n is ...

6 years ago | 0

| accepted

Answered
How can I prevent the clicked figure taking the focus?
The default behavior of the plot() command is to plot into the currrent axes in the current figure. Clicking a figure makes it t...

6 years ago | 0

Answered
Why does single element null assignment succeed, but multiple element null assignment fails?
Even though the sizes do not match, the first assignment succeeds because 0 is a scalar. MATLAB replicates scalars as necessary ...

6 years ago | 0

| accepted

Solved


Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs. Example X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2] ...

13 years ago