Answered
How do I collect all data strings of an array that meet 2 criteria
A much more efficient way that does not involve growing the result array through a loop (always going to be slow): %inputs:...

11 years ago | 0

| accepted

Answered
How do I plot data from a structure with time?
Most likely, this will work: plot(Control_Logic.time, [Control_Logic.signals.values]) The |[Control_Logic.signals.values...

11 years ago | 4

| accepted

Answered
Serial protocol: How to interpret command structure?
In your documentation, there should be an introduction that explains the general format of the commands. It' not clear from the ...

11 years ago | 0

Answered
I want to plot the values of each month and the respective year in one line, so basically 34 lines in a plot to show how the values are changing for 34 years
As per the documentation of plot, when supplied by a matrix it plots the columns as individual curves. So if you want to plot th...

11 years ago | 0

| accepted

Answered
why the loop is giving repeated array
You need to learn to <http://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html debug> your program. ...

11 years ago | 0

| accepted

Answered
How do I use chunks from strsplit in Matlab to save along with my data in a text file?
You would basically loop over your files, read the content, add the prefix (see tudor's answer and related comments) to each lin...

11 years ago | 1

Answered
Summing identical submatricies to get a smaller final matrix
Firstly, |sum| applied to a matrix return a row vector, not a scalar. Secondly, your |fun| function does not work on a block but...

11 years ago | 0

| accepted

Answered
I have this error in my work wich occur ;Error using * Inner matrix dimensions must agree.
For the line D = (1./sigma)' * (data .* data) - 2 * (mu./sigma)' * data + ndim * log(2 * pi); in your |lgmmprob| func...

11 years ago | 0

| accepted

Answered
How to divide an image into 3*3 grids?
Have a look at <http://www.mathworks.com/help/images/ref/blockproc.html |blockproc|> result = blockproc(img, [3 3], @somefu...

11 years ago | 0

| accepted

Answered
Generating random number between 1 to 10 but having discrete steps
output = rand(1, 10) * 10; There's no guarantee that the 10 values are unique but the probability that you have two identic...

11 years ago | 0

| accepted

Answered
Is it possible to pass pointers to MATLAB structures through a COM interface?
It's been a long time since I've written any COM interfaces but I'm fairly certain that passing raw pointers around is completel...

11 years ago | 1

| accepted

Answered
How to clear existing figure in excel using matlab?
Here is a more efficient version of your original code: excel = actxserver('Excel.Application'); workbook = excel.Workbo...

11 years ago | 0

| accepted

Answered
Indexing into an array for a scorecard.
Note that |x| is a cell array, not a matrix. Also, it's not a particularly good idea to store the metainformation (column and...

11 years ago | 0

Answered
How to create an array of vectors corresponding to a particular point
If I understood correctly, you have |X|, |Y|, and |Z| generated by: R=22; phi=linspace(0,pi,50); theta=linspace(-pi/2,pi/2,...

11 years ago | 0

| accepted

Answered
How to find multiples of x in a row vector?
First of all, it's entirely possible you don't need the |find| function. Unless you actually need the indices of the element tha...

11 years ago | 1

| accepted

Answered
Compare multiple columns in a cell array with strcmp
Hum, why not use logical operations? hill_log2 = runlog1(strcmp(runlog1(:,4), 'Hill') & strcmp(hill_log(:,6), 'Kilometer'),...

11 years ago | 0

| accepted

Answered
assign the content of a structure to another
There's something that you're not explaining correctly. _"I want to change its content at the end of the round to use what is in...

11 years ago | 0

Answered
Matlab & Arduino "Maximum recursion limit of 500 reached." problem
Anil, maybe you should look at <http://www.mathworks.com/matlabcentral/answers/contributors this page> before criticising Walter...

11 years ago | 0

Answered
Subscripted assignment dimension mismatch.
First, you should use |fullfile| to build paths rather than building them yourself. filelist = dir(fullfile(Direc, [somepr...

11 years ago | 0

Answered
How do I divide a 3X3 matrix in three vertical or horizontal one-dimensional vectors using a FUNCTION?
First and foremost, why? Why can't you keep using the 3x3 matrix and refer the rows / columns as appropriate? In all likelihood ...

11 years ago | 0

Answered
Conditional Statement with 3 different ranges
You cannot use the notation |if a<b<c| to check that |b| is between |a| and |c| in matlab (in fact, I'm not aware of any program...

11 years ago | 0

Answered
how to return two results by one output when using arrayfun()?
It's not clear what sort of output you are looking for out of |arrayfun|. You have two options: * Use a single output functio...

11 years ago | 2

Answered
How to read 12bit raw data faster?
Certainly, using |dec2bin| is going to be slow since it involves conversion to and from strings. You can manipulate bits directl...

11 years ago | 0

Answered
Equality of a numeric list using a string
I'd recommend you use function handles rather than strings: comparisons = {@gt, @lt}; %gt is the function name of >, lt is ...

11 years ago | 1

Answered
How to select particular rows of a matrix?
This is basic matrix indexing that is covered in the <http://www.mathworks.com/help/matlab/learn_matlab/array-indexing.html gett...

11 years ago | 2

Answered
Creating permutations of all possible non-repeated combinations within N elements
Ignoring for a moment your requirement that _"beyond the brackets, permutation must occur"_, you're asking for all the <https://...

11 years ago | 2

| accepted

Answered
Calculate time for count
While theoretically, you could pace your loop to run at whichever speed you want by using <http://www.mathworks.com/help/matlab/...

11 years ago | 1

Answered
Remove completely an object inside another object
You use the same rules to delete array elements regardless of their content, so: Bolt(1, 1).PipeBolt(N, 1) = [];

11 years ago | 0

| accepted

Answered
How to Assemble the matrix shown in the image on Matlab for any number of nodes?
There is not enough information to know how to construct the main diagonal, but you can just |sum| a bunch of <http://www.mathwo...

11 years ago | 0

Load more