Respondida
Open matlab in fortran environment
The general advice here is 1) Have MATLAB call your Fortran code as a mex routine, and then use the mexCallMATLAB functio...

más de 11 años hace | 0

Respondida
Need help with for and while loops.
Matrix Multiply: Start with the MATLAB doc for this, in particular the formula for the element C(i,j) of the result from this pa...

más de 11 años hace | 0

| aceptada

Respondida
Could anyone help me with an anonymous function trouble please?!
Make the argument of myfun a vector. E.g., myfun = @(x) ((x(1) - 2).^4 + (x(1) - 2*x(2)).^2 + (x(1).^2 - x(2)).^2); fmin...

más de 11 años hace | 1

Respondida
Multiplication - array by double, vector by double, saving to variable
What is size(amplitude{1})? t is a vector, so A*sin(f(k)*t) is a vector, which can't be assigned to a single element sins(k)....

más de 11 años hace | 2

| aceptada

Respondida
how to compare two different matrix and set a counter to calculate how many rows matches with all its columns??
The above code is all commented out (begins with % and appears green in the editor). Is this the actual code you are trying to r...

más de 11 años hace | 0

Respondida
How to convert string with complex numbers to matrix
E.g. simple code assuming no blanks in the numbers, S = '5+6i 3-2i 1-i @ 4+i 2-0.2i 2.5-1.3i @' S(S=='@') = ';'; x = ...

más de 11 años hace | 0

| aceptada

Pregunta


datetime 'UTCLeapSeconds', 2 second difference across leap sec boundary
I was recently made aware of the leap second capability in the new datetime class of R2014b, so I did some simple tests and did ...

más de 11 años hace | 3 respuestas | 2

3

respuestas

Respondida
how to use matlab garch function in C++ (using the C/C++ compiler)
The general advice here is 1) Have MATLAB call your C++ code as a mex routine, and then use the mexCallMATLAB function inside...

más de 11 años hace | 1

| aceptada

Respondida
How to make a column vector of 2 distinct numbers
[ones(100,1);2*ones(300,1)]

más de 11 años hace | 0

Respondida
How to recognize multiplication with out *
Brute force loop: s = '2x + 3 - 5y'; isdigit = @(x)(x>='0'&x<='9'); s(s==' ') = []; % if you want to protect against ...

más de 11 años hace | 0

| aceptada

Respondida
Why does isfield return with false when the field does exist in a structure?
It looks to me like the variable current_struct_field is a string, not a struct, so isfield will return a 0 since you didn't pas...

más de 11 años hace | 0

Respondida
unable to run due to the following error..can any one help me out in dealing with the error mentioned in the body below???
You have a function that is directly or indirectly calling itself, and there was no exit criteria reached before it called itsel...

más de 11 años hace | 0

Respondida
how to delet multiple rows with single criteria in matlab
Are you trying to delete all three H1, H2, H3 rows if any of the x values in those rows are >= 3? If so, in your example it look...

más de 11 años hace | 0

Respondida
Vector values replaced by zeros
The values in all likelihood are not exact 0's, they just display as 0's to the precision that is printed. To print more digits,...

más de 11 años hace | 1

Respondida
convert a numbere from integer to double
Your question is not clear. If the number is a scalar double and exactly 1, it will display as 1 without the trailing 0's. If it...

más de 11 años hace | 3

Respondida
Error when using openmp 'collapse' directive in matlab mex
Does your compiler support the collapse directive? What compiler are you using?

más de 11 años hace | 1

| aceptada

Respondida
Segfault when trying to use std::vector in mex function
Your post suffers from the fact that you show only partial code snippets of lines, making it impossible for the reader to know e...

más de 11 años hace | 0

Respondida
How can I reorder paired points
Brute force: [~,x] = min(a(:,1)); result = zeros(size(a)); m = size(a,1); result(1,:) = a(x,:); for k=2:m ...

más de 11 años hace | 0

Respondida
Call on Dynamic Variable
Please see this post about having variables named sensor1, sensor2, sensor3, etc and then trying to process them in a loop: h...

más de 11 años hace | 1

Respondida
Intersection of two functions
You missed the pi constant when taking the derivative of sin((pi/2).*x). You only pulled out the 1/2 constant instead of the ent...

más de 11 años hace | 0

| aceptada

Respondida
Assigning an opertation vector to a variable
Is this what you want? function result = myfunction(v) v(mod(v,2)~=0) = 0; result = v; return

más de 11 años hace | 0

Respondida
How to rearrange matrix elements by making last row as first row, etc?
flipud(your_matrix)

más de 11 años hace | 4

| aceptada

Respondida
Could exponent of an array be inproved in speed ? Maybe mex file with exp function (reduced accuracy) for windows 64 bit.
For your particular posed example all the elements are the same, so only compute the exp calculation once and don't do all of th...

más de 11 años hace | 1

Respondida
Opposite of repmat() ? Collapse an array with repetitions
reshape(your_array(1,:,:),X,Y)'

más de 11 años hace | 0

Respondida
How do I delete a row in a matrix?
>> a = [1 3;2 0;3 11;4 8;5 0] a = 1 3 2 0 3 11 4 8 5 0 >> a(a...

más de 11 años hace | 0

| aceptada

Respondida
How can I create a matrix of equal element value?
y = 121*ones(5,80);

más de 11 años hace | 2

| aceptada

Respondida
How to import C++ arrays into Matlab & loop over a C++ program from within Matlab?
Thanks for posting your code. I haven't checked your indexing logic yet, but before we get into that you must first correct y...

más de 11 años hace | 2

| aceptada

Respondida
How does the cycle for , if work?
The reason it doesn't produce any output is because the sum is never 0. E.g., print out S each iteration to see what is going on...

más de 11 años hace | 0

Respondida
Selecting a random question from a pool of questions until all questions are selected.
If you have n questions, then q = randperm(n); Gives you a random ordering of the numbers 1 through n. You can use that ...

más de 11 años hace | 0

Respondida
Insert a changing number into a variable in matlab?
Yes there is a way to do this using the eval function, but you will be buying a LOT of headaches with your programming in the fu...

más de 11 años hace | 0

Cargar más