Answered
finding unique cell elements from different size of matrix
Your question has nothing to do with |unique|. The element that occurs the most often in a set of data is called the <https://en...

8 years ago | 1

Answered
Import multiple excel files into multiple variables (or matrices)
Your code has a bug in it: you use an absolute file path with |dir| but not with |xlsread|. But the biggest problem is with your...

8 years ago | 2

| accepted

Answered
Is there a way to get the switch and case function to be part of the overall formula?
It is a good start, but you should: * read the help for each function that you use, then you would learn than |input| does no...

8 years ago | 0

| accepted

Answered
How to find a string in the following cell structure?
Storing lots of separate scalar structures in a cell array is less convenient than just using one <https://www.mathworks.com/hel...

8 years ago | 0

Answered
add element to cell
>> idx = ~all(ismember(E,[M{:}]),2); >> M = [M(:);num2cell(E(idx,:),2)]; >> M{:} ans = 1 2 5 ans = ...

8 years ago | 0

| accepted

Answered
How to multiply each row of a matrix with a second full matrix, while applying a formula
In just one line, works for any number of rows of |a| and |b|: >> a = [3,4,5,1;3,2,0,4]; >> b = [1,2,3,4;2,0,2,4;0,4,8,2...

8 years ago | 0

Answered
Information lost when extracting individual images from video.
You should simplify and improve your code, e.g.: * use |dir| to match the |*.mpg| pattern rather than using |endsWith|. * us...

8 years ago | 1

Answered
Can someone help me understand this code. Its a plate bending code.
<https://www.mathworks.com/matlabcentral/fileexchange/32029-plate-bending> The files |coordinates.dat| and |nodes.dat| are in...

8 years ago | 0

Answered
How can I use for-loop to implement variable parameters?
Following the advice of old questions and answers is not a good idea, because the syntax can change. To parametrize a function y...

8 years ago | 0

Answered
Importing data files with the same name in different directories (seeds) , setting them equal to "loop able" variable
_"I will say that I've written a verbose form of this code that sets variables for every import. I have 25 simulations with 20 s...

8 years ago | 1

| accepted

Answered
fprintf linspace and variable IN THE RIGHT ORDER
Get rid of the loop entirely, you don't need it: x = linspace(0,10,p); y = (m*x)+c; fprintf('The y value when x equal...

8 years ago | 0

Answered
Computing the average across columns, while discounting a specific column
Say you have a matrix |M| and you want to get the mean of each row, ignoring the third column: N = 3; % column to ignore ...

8 years ago | 1

Answered
How can I get the length of the intersection of each row of a matrix with another vector?
*Method one: <https://www.mathworks.com/help/matlab/ref/ismember.html |ismember|>:* >> sum(ismember(C,V),2) ans = ...

8 years ago | 0

| accepted

Answered
Can a function access variable which were not input variables?
_"Can a function access variable which were not input variables?"_ Yes: this is easy using <https://www.mathworks.com/help/ma...

8 years ago | 0

Answered
Vectorization of a nestled loop
You can use <https://www.mathworks.com/help/matlab/ref/mtimes.html matrix multiplication>: matA.'*B(:) which gives an ou...

8 years ago | 0

| accepted

Answered
why meijerG function is undefined variable in matlab
Probably you don't have the Symbolic Toolbox installed, or you don't have a license for it, or the function is not supported for...

8 years ago | 0

| accepted

Answered
ode45 error: must return a column vector
p = v-(s0.*v.*x)./g; You need to learn about the differences between matrix operations and array operations: <https://ww...

8 years ago | 0

Answered
Why does my cellfun fails?
_"...however if I try to apply the same command again as..."_ You have failed to take into account that inbetween running the...

8 years ago | 0

| accepted

Answered
How can I read and plot files with dynamic name and plot them in a single graph?
Depending on what numeric values those filenames contain, this might not be so trivial. To get the files in the correct order yo...

8 years ago | 1

Answered
How do I calculate the maximum value of an array of structures within a structure ?
Here is one simple solution _that does not rely on a specific order of any of the fieldnames_: % fake data (fields not in n...

8 years ago | 0

Answered
How to separate vector into vectors of different lengths
The simple MATLAB way: >> y = 1:10; >> x = [2,5,10]; >> c = mat2cell(y,1,diff([0,x])); >> c{:} ans = 1 ...

8 years ago | 2

Answered
[GUI] Update variable in while loop
If you want any values of |handles| to change inside that loop because of something that you did in another callback then you wi...

8 years ago | 0

| accepted

Answered
COMBINING MULTIPLE TABLES TOGETHER
_"I have used the eval function to do the job but I want to do it without eval function??"_ That is a good idea, because |eva...

8 years ago | 0

Answered
Iteratively save data to mat file
_"I would prefer that all the data is saved to a single variable in a single Mat file but I don't see how to do that efficiently...

8 years ago | 1

Answered
Unable to draw files from a folder
This will get all the filenames, remove the filenames starting with |._|, sort the filenames into alphnumeric order, and then im...

8 years ago | 1

| accepted

Answered
store image in a handle.
When you save |I| using |guidata| you replace the |handles| structure with |I|, and so |handles| does not exist any more (and he...

8 years ago | 0

| accepted

Answered
hi,this is my code
Replace this: >> z=[1:1:2339]; >> [Z]=meshgrid(z); With something like this: >> Z = nan(size(Y)); >> Z(:) = 1...

8 years ago | 0

Answered
How to find and store specific parameters in text file.
One very simple solution would be to read the whole file and use a regular expression. Something like this: D = 'directory ...

8 years ago | 0

Answered
how to find the minimum value of the wholw matrix?
This works for any size array: min(A(:))

8 years ago | 5

Load more