Answered
How to extract elements from an array in three different array
A = randi(100, 1, 19) splits = [7 5]; B = mat2cell(A, 1, [splits, numel(A) - sum(splits)]); celldisp(B) Use cell a...

11 years ago | 0

| accepted

Answered
Aggregating time series with gabs in data?
The way to solve this is to transform your date and second into a single value that preserve the ordering. You can then discreti...

11 years ago | 0

Answered
Using regexp in a repetitive manner
If you want the numbers from all the lines just as a vector and assuming there are no unwanted numbers in any other line then it...

11 years ago | 0

| accepted

Answered
Sort row by row cell matrix?
a = {'c', 'b', 'a'; 'c', 'a', 'b'; 'c', 'b', 'a'} num2cell(sort(cell2mat(a), 2)) is all that is needed...

11 years ago | 0

Answered
Quicker way from for loop for reading columns from different csv files in the same folder
Parsing 10600 text files is always going to be slow, particularly on Windows which probably struggles with that many files in a ...

11 years ago | 0

Answered
How to save struct data from struct to excel?
We could do with a lot more details about what you want to do. Do you want the field names to be saved? Is the structure scalar ...

11 years ago | 8

| accepted

Answered
How to check if one file selected when using MultiSelection in matlab?
<rant> This is a thing I hate about the way mathworks design their language. All these special cases where a function beha...

11 years ago | 9

| accepted

Answered
how to clear the border of matrix?
It's actually very simple using <http://www.mathworks.com/help/matlab/set-operations.html set operations>: img = [1 1 1 2 2 ...

11 years ago | 1

| accepted

Answered
Can we use elseif in a conditional statement this much time?%shortest path selection algorithm for R1
You can use as many |elseif| as you want. Whether it is wise, probably not as it makes it harder to understand the code, particu...

11 years ago | 1

| accepted

Answered
How do I do task 4?
_"The program must have a specific sequence of answers"_: Yes, the code to do that is even already provided in the template you'...

11 years ago | 0

Answered
to change without using function in MATLAB
Functions are an essential part of programming languages and make the code clearer. Why wouldn't you want to use them in matlab?...

11 years ago | 0

Answered
Can I run the same script (and subfunctions) from two diffent matlab windows?
Scripts and functions are simply text files. They are not executables. So, yes They can be run without any issue(*) from as many...

11 years ago | 0

Answered
Impossible de se connecter sur Mathworks account
La majorite des volontaires qui repondent aux questions sur ce forum n'ont aucune connection avec Mathworks. Parmis ceux-ci, peu...

11 years ago | 1

Answered
How do I create a matrix with functions?
The simplest way is to use <http://www.mathworks.com/help/releases/R2015b/matlab/ref/bsxfun.html |bsxfun|>: var1 = 1:10; ...

11 years ago | 0

Answered
convolution of a signal with itself
Simply use <http://www.mathworks.com/help/releases/R2015b/matlab/ref/conv.html |conv|>: t = linspace(0, 2*pi, 1000); %for e...

11 years ago | 1

Answered
How to convert 3D matrix to 1D?
The way to do this is to reshape your image into an nx3 matrix where each row correspond to the three colours of a pixel. You ca...

11 years ago | 1

| accepted

Solved


Find Missing Number
A little problem (inspired by CodeChef) for the coffee break. A friend give you an array of size n-1 integers and these int...

11 years ago

Solved


Change number representation to HEX
Given a number change it's representation to HEX and output it.

11 years ago

Solved


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

11 years ago

Solved


Recursion - Fun
Generate the first k terms in the sequence a(n) define recursively by a(n+1)=p*a(n)+(1+a(n)) with p=0.9 and a(1)=0.5 ...

11 years ago

Solved


Print the date for a given number using Indian calendar reference
Print date for a given number in date reference is INDIAN calendar, not Christ's Birth The Vikram Samvat is said to have been...

11 years ago

Answered
Hello, I have question which i need to solve. if i got a matrix, how can i check if there is any equal rows in it ? without using loops,if,unique,for :\ thanks
Without using loops or |unique|, I don't think it's really possible. You can cheat by using set functions such as |union|, |setd...

11 years ago | 0

Answered
how to make sparse, group association
_" I would prefer the matrix to be symmetric."_ Why should it be? If person 1 and 2 are associated with group 4, it does not mea...

11 years ago | 0

| accepted

Answered
bucket sort on cell array of vectors
c1 = {[1 2] [10 11];[2 3] [10 11];[1 2] [11 12]; [2 3] [11 12]}; c2 = table2cell(sortrows(cell2table(c1))) Note that you...

11 years ago | 1

| accepted

Answered
Undefined Variable/Function hObject???
It looks to me that line 24 is actually declaring the callback function and thus should read: function callbackfn(hobject, ...

11 years ago | 0

Answered
why does size() not work in function but does in workspace
You need to understand the difference between |()| and |{}| when applied to cell array. |()| returns a portion of a cell array a...

11 years ago | 0

| accepted

Answered
How to resolve, "Nonscalar arrays of function handles are not allowed; use cell arrays instead."
An alternative to Walter's solution that avoids the |TCN| recursion: C=1; V=5; R=4; t=linspace(0,20,22); for n ...

11 years ago | 1

Solved


Polynomial Evaluation
Create a routine that takes a list of coefficients of a polynomial in order of increasing powers of x; together with a value of ...

11 years ago

Solved


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

11 years ago

Answered
How to run multiple for loops for values of x up to y and then from y up to z.
a = 3; b = 30; c = 4; %for example x = linspace(0,b,1000); %ignoring the i loop, since it's irrelevant to your question ...

11 years ago | 0

Load more