Answered
Compute all combinations of given vectors into a matrix
Your question is not clear at all. Assuming you want to generate all combinations |{[a;b], [a;c], [a;d], [b;c], [b;d], [c;d]}|, ...

9 years ago | 0

Answered
Convert String to instrument.OscilloscopeObject
I'm not sure you can pass objects through matlab COM interface. Why don't you use |Execute| instead of |Feval| to create the osc...

9 years ago | 0

| accepted

Answered
Spacing in defining complex numbers?
The whole reason for this is that you're not consistent with your spacing around the operators. Either put a space before *and* ...

9 years ago | 0

Answered
for VideoReader command , Matlab 2009a is suitable?
Note: your version of matlab comes with documentation. In that documentation there is a search box. You'll get answers faster us...

9 years ago | 1

Answered
how to remove this error
I suspect you want z = wavread(f); %and what's the point of x=z on the next line. Read the file as x directly if you m...

9 years ago | 0

Answered
Matlab 3D matrix same index condition
It's not clear what C should be when A is smaller than B. Option 1: C should be B when A is smaller than B. This is triviall...

9 years ago | 1

| accepted

Answered
How do I record all cases where two columns sum to a third?
A solution that does not involve any loop: m = [2 0 1 2 1 1 1 0 0 1]; [col1, col2] = ndgrid(1:size(m, 2)); %...

9 years ago | 0

| accepted

Answered
How can I find the highest value in an array that is smaller than the value at i+1?
end_event_f = nan(size(start_event)); %predeclare for speed for evidx = 1 : numel(start_event) - 1 end_event_f(evidx)...

9 years ago | 1

| accepted

Answered
Generation of random co-prime integers modulo n
Your question is missing a lot of information. What is the range for the integers to generate? What is the range for n? Should t...

9 years ago | 0

| accepted

Answered
If loop to know if event happens on a matrix then 1, how to do it?
m = [0012 1 0013 1 0012 2 0012 2 0012 2 0013 2 ...

9 years ago | 0

Answered
Adjusting my loop (help needed)
Everything including finding the mean can be done in just three lines of code using <https://www.mathworks.com/help/matlab/ref/f...

9 years ago | 2

| accepted

Answered
how to speed up datestr conversion?
Specifying the format would greatly speed up the conversion: tnum = datenum(M1.Var1, 'HH.MM.SS.FFF') - datenum(2017,1,1) + ...

9 years ago | 0

Answered
Loading in png file that is black
Your description was not very accurate. The image is not black, it simply is the wrong colour, with the background showing black...

9 years ago | 0

Answered
problem explicitly calling subsasgn with buitlin method
This is interesting. There's definitively something not working properly there. Experimenting with your test case, I changed the...

9 years ago | 2

Answered
How to restart PC and then automatically run a vbs script generated by Matlab before restart?
This is not really a matlab question since you'll have to delegate to the OS for that. You could use <https://msdn.microsoft....

9 years ago | 1

| accepted

Answered
Average matrix columns until convergence
There's no need for a loop. Compute the cumulative average of the rows, use |diff| on that and compute the |max| of each column....

9 years ago | 1

| accepted

Answered
How to use cellfun in only cells with numbers or how to create a csv file with different elements (numbers and strings)?
You would be better off fixing whichever code you've used that creates a mixture of numbers and strings in the same column. You ...

9 years ago | 0

Answered
sum up pixels by using simple continued fraction
Your question is confusing since you're talking about *rows* yet you show a *column* vector in your example. To compute the c...

9 years ago | 0

Solved


A different counting method
Given an array (x) of integers, the "counting" array (y) is showing the number of identical consecutive integers in x in front o...

9 years ago

Solved


Evaluating continued fractions
Given row vector c=[c0 c1 c2 c3 ...] evaluate the continued fraction x=c0+1/(c1+1/(c2+1/(c3+...))) If c is a ...

9 years ago

Answered
Error when trying to use if exist command. variable exists but it is not recognising it
Notwithstanding the syntax error in your |else| branch, the problem you have is that you're not passing a variable name to |exis...

9 years ago | 0

Answered
Fast method count unique variables
No idea if it's faster than your method, this does not need a loop: m = [2 1 3 4;1 2 3 4;1 2 4 3;2 1 4 3]; %demo data c...

9 years ago | 1

Answered
Export SQLite database to .mat(.m) file
If you have the database toolbox, importing all rows of a table from an sqlite file is trivial: conn = sqlite('yourdbfile.d...

9 years ago | 0

| accepted

Answered
How to generate a function that takes a 3-element column vector as an input and returns three output arguments?
Obviously, a function that's supposed to take *one* vector as input will have exactly *one* input argument. So the signature of ...

9 years ago | 1

| accepted

Answered
Function takes far too long to run, and then doesn't write all the values to a text document.
Your code runs fine for me (and write all the entries to the file) >>tic; GetLeapYears(0, 10000); toc; Elapsed time is 0...

9 years ago | 0

| accepted

Answered
How are classes and objects created in matlab
It's all in the documentation with plenty of examples: <https://www.mathworks.com/help/matlab/programming-and-data-types.html...

9 years ago | 2

| accepted

Answered
What's the difference between GrayThresh and OtsuThresh?
The only significant difference is that |graythresh| wants the image as input, whereas |otsuthresh| wants the image histogram in...

9 years ago | 1

| accepted

Answered
How can i draw this function and it`s derivative?
Surely, in your course you've been told of the <https://www.mathworks.com/help/matlab/ref/plot.html |plot|> function. If not,...

9 years ago | 1

Answered
Don't let the function display any output
You could wrap the call to the function in <https://www.mathworks.com/help/matlab/ref/evalc.html |evalc|>. The downside, as with...

9 years ago | 0

Answered
Database Toolbox select a certain date error datatypeconflict criteriastatement
Note: I know nothing about the database toolbox as I don't have it and have never seen a need for it to communicate with access ...

9 years ago | 0

| accepted

Load more