Answered
How can fix the Error using dir Function is not defined for 'cell' inputs?
The fix is simple, don't pass a cell (an empty one at that) to |dir|. It's not clear what you're trying to do. |rootpath| mus...

11 years ago | 0

| accepted

Answered
Split or extract a part of the data in a cell
An alternative to Arnab's answer, using <http://www.mathworks.com/help/matlab/ref/cellfun.html |cellfun|>: A = cell2mat(cel...

11 years ago | 1

Solved


Why?
Why has been a major question throughout history; why did Napoleon fail, why do we exist, why must I work a pageant, to name a f...

11 years ago

Solved


Matrix diagonalization
You will be given Two matrices A and B. Return 1 if B is the diagonal matrix of A, 0 otherwise

11 years ago

Answered
Program that enters a date and returns the day after?
Well, simply let matlab do it for: d = datetime(2016,2,28, 'Format', 'dd MMMM yyyy') %leap year d+1 d = datetime(2...

11 years ago | 0

Answered
How do I remove empty indexes in a structure?
No need for a loop in the first place: refinedStats = stats([stats.Area] > 50);

11 years ago | 2

| accepted

Answered
How do I get the fork points of a skeleton of an image?
How about? skelimage = bwmorph(binaryImage, 'skel', Inf); branchimage = bwmorph(skelimage, 'branchpoints');

11 years ago | 2

| accepted

Answered
how to do logical indexing
See <http://www.mathworks.com/help/matlab/math/matrix-indexing.html#bq7egb6-1 Using logicals in array indexing>. In your case it...

11 years ago | 0

| accepted

Answered
How to find which elements for each row of matrix B (NxM) are contained in matrix A (NxK), in their corresponding row n using vectorization?
I don't think there's going to be a faster way than iterating over the rows to do what you want. The way you've constructed your...

11 years ago | 0

Answered
Combining 10 vectors of decimal numbers into a single matrix
To expand on Stephen's comment, what is most likely happening is that one of the vector you're concatenating is of an integer ty...

11 years ago | 0

| accepted

Answered
'' Attempted to access sorted_evalue(1); index out of bounds because numel(sorted_evalue)=0. '' how to remove this???
It would be helpful to know which line is causing the error. It should be part of the error message. With the code you've pos...

11 years ago | 0

Answered
How to consolidate answers into a vector?
If you really want to use a loop, you'd have to grow the |vout| and |pos| vector each time you find a negative number. This is i...

11 years ago | 1

Solved


easy multipliation
return y to be equal to 2 * x

11 years ago

Solved


Find C in a right triangle
Given a right triangle A and B. Find C is hyponutuse

11 years ago

Solved


Find the nearest prime
Given a positive integer 'n', the task is to find a prime number closest to 'n'. The distance between two numbers is the dis...

11 years ago

Answered
Will Matlab ever permit C++ DLL's?
No, it's not going to happen. It's not possible. It's not an issue specific to matlab. It's all to do with the fact that C++ ...

11 years ago | 1

Answered
how to calculate pixel value differences?
In your example, it actually works the way you want. The most likely reason why it does not work with your real image is that yo...

11 years ago | 1

| accepted

Answered
How to save the output of matrix calculation with different dimension
You do not want to save the result as separate numbered variables. As a rule, if you start numbering variables, you're doing it ...

11 years ago | 0

Answered
How to use randperm to create a vector with multiples of the same number?
So, why not? A_before = repmat([2:11, 10, 10, 10] , [1 2]); A = A_before(randperm(26))

11 years ago | 0

| accepted

Answered
Cell array to meet conditions and cell indexing
I'm not really clear on the format of the output you want, but the following should give you an idea what to do: C = {[1:10...

11 years ago | 0

| accepted

Answered
Possibility to access/use whole structures
See <http://www.mathworks.com/help/releases/R2015b/matlab/matlab_prog/access-multiple-elements-of-a-nonscalar-struct-array.html ...

11 years ago | 0

Answered
how to insert a new column to a matrix after its every two column?
A more generic version of Stephen's method 1: skipcolumns = 2; bcols = (1:size(b, 2)) * (skipcolumns+1); assert(size(...

11 years ago | 0

| accepted

Answered
How to find the exact values in a column and make a computation according to the next column of it?
It's not very clear what you're asking. If all you want is to know how many different machines are required for each station, it...

11 years ago | 0

| accepted

Answered
??? Subscript indices must either be real positive integers or logicals in neural network
minmax = [min_P, max_P]; |minmax| is a vector with two elements Px = load('bobotuji/minmax.txt'); |Px| is a matrix/v...

11 years ago | 0

Answered
How to I fix this error Varargin? I think the image is 512 byte binary labeled lenna.512.
None of the valid <http://www.mathworks.com/help/releases/R2015b/matlab/ref/imshow.html |imshow|> syntaxes accept a single scala...

11 years ago | 1

Answered
How to read line by line from one file and find each line to another file and locate it?
A simple way: leftcontent = strsplit(fileread('c:\somewhere\your\1stfile.csv'), {'\n', '\r'}); %read 1st file and split int...

11 years ago | 1

| accepted

Solved


P-smooth numbers
This Challenge is to find <https://en.wikipedia.org/wiki/Smooth_number P-smooth number> partial sets given P and a max series va...

11 years ago

Answered
Sorting sub matrices based on specific column value
I've not really tried to understand your code, nor have I run it, but if all you want to do is sort a column according to its di...

11 years ago | 1

| accepted

Solved


Find the Hypotenuse
Find the Hypotenuse of the triangle.

11 years ago

Solved


Adding numbers
Add two numbers together

11 years ago

Load more