Respondida
MEX gfortran type mismatch error
The only thing funny I see in your code at first glance are these function return type declarations: mwsize mxgetm, m...

más de 7 años hace | 0

Respondida
Why am I getting a parse error?
Please post the complete error message text, along with the offending line. I can only guess that maybe you have a variable name...

más de 7 años hace | 0

Respondida
While loop is not stopping at value.
This line yini=yini+(h*f); makes yini a vector, since f is a vector. Given that, is the following test which is operatin...

casi 8 años hace | 0

Respondida
I don't know Why my mex function associated with a Fortran 77 does not work. Can anybody help me?
1) "size" is the name of an intrinsic Fortran function that you shouldn't shadow. Pick a different name for your variable. 2)...

casi 8 años hace | 0

| aceptada

Respondida
need to print a matrix with a string
Assuming there are three grades in the quiz field, maybe this will work for you fprintf('%s %d %d %d\n',student(i).lastn...

casi 8 años hace | 0

Respondida
datenum to UTC?
Are you just looking for how to convert from the former to the latter? E.g., s = '10-Oct-2013 15:59:00'; unix_m4 = (date...

casi 8 años hace | 0

| aceptada

Respondida
How can I delete row based on the value of row (i) and row (i+1)
I _think_ this is what you are asking for (i.e., delete all rows that have equal neighbors in column 10): X = your matrix ...

casi 8 años hace | 0

| aceptada

Respondida
how to transfer data from MATLAB to c++ using MEX
Here is some example code for you. It is written as a mex routine but you should be able to adapt the functions to your Engine a...

casi 8 años hace | 0

| aceptada

Respondida
How do I create a column vector of random numbers with interval [-0.1;0.1], with N elements?
N = whatever de = whatever result = rand(N,1)*(2*de) - de;

casi 8 años hace | 0

| aceptada

Respondida
Error out of memory
Type the following at the command line: dbstop if error Then run your code. When the error occurs, the code will pause w...

casi 8 años hace | 0

Respondida
Simple Math With Complex Arrays
So, MATLAB has functions i and j defined as the imaginary sqrt(-1) values. I notice that you are using i and j as indexing. This...

casi 8 años hace | 0

Respondida
output argument not assigned
Based on what you have posted, it appears var has more than 3 dimensions, so you aren't getting into your code above.

casi 8 años hace | 0

Respondida
My professor is driving me crazy.
Maybe he wants the results presented in columns? tmax = 50; step = 5; t = (0:step:tmax)'; % make it a column X = [...

casi 8 años hace | 1

Respondida
What is the solution of this problem? this is array 13*13
It means the pieces do not form a 13x13 matrix. That is what you need to fix.

casi 8 años hace | 1

Respondida
Simulating gravity, forces seem to be miscalculated (need help)
I don't have the time to step through your code, but I don't see where you set the sign of F as an attracting force. Maybe all y...

casi 8 años hace | 0

Respondida
How to add uniform noise with given range
lower_bound = something upper_bound = something n = number of samples u = lower_bound + rand(1,n)*(upper_bound-lower_...

casi 8 años hace | 0

| aceptada

Respondida
representation of positive and negative number to binary 1 and 0 in matlab
result = volts > 0; This will give you a logical result. If you need the result to be double, then simply result = dou...

casi 8 años hace | 1

Respondida
Matlab if statements in physics
You can easily run the code to see that it clips the values outside of [-1,1] so that they stay in this range. But it appears th...

casi 8 años hace | 1

| aceptada

Respondida
inv matrix command error
Normally the inv is applied to the left hand side coefficients, since people usually write the "A" matrix on the left and the "b...

casi 8 años hace | 0

| aceptada

Respondida
Log equation log(x) not plotting correctly
Since you are trying to graph the inverse of the functions, you should be switching the domains as well when you generate the po...

casi 8 años hace | 0

Respondida
How do I implement cosd in simulink
You could use a MATLAB Function block, or perhaps scale the input prior to going into a sin block.

casi 8 años hace | 0

Respondida
Orbit by euler's method
I don't see anything obviously wrong with your code. So other possibilities to consider are: - The step size is too large for...

casi 8 años hace | 0

Respondida
Use a "while" loop to create the vector x = [4 16 28 40]. Note the constant increment of 12.How can i put the ic values in x.Help please
You need something inside the while loop that sets the value of the x elements. E.g., k = 1; while ic < 40 x(k) = ...

casi 8 años hace | 1

| aceptada

Respondida
error in Euler method
You need to recalculate the derivatives at _each_ time step. So all of the stuff that goes into calculating dX needs to be insid...

casi 8 años hace | 0

| aceptada

Respondida
Unusual slowdown using sum.
Are you pre-allocating Grandarray?

casi 8 años hace | 0

Respondida
Trying to develop a program to implement Euler's Method for a second order system
Here's a start: Create a file called deriv.m in your working directory. Since you will have two first order equations, define...

casi 8 años hace | 1

Respondida
MATLAB Coder: Matrix-Scalar-Multiplication slower in generated code?
I'm only seeing about a 5% difference in timing when comparing the BLAS dscal function call to an explicit loop in my R2017b Win...

casi 8 años hace | 0

| aceptada

Respondida
How to solve a first order ODE system with coupled equations
If you have these dependencies among the dy4/dt, dy5/dt, and dy6/dt terms, then you need to first solve for them uniquely. Just ...

casi 8 años hace | 0

| aceptada

Respondida
Is there any way to display a row of a character vector?
Not sure if this is what you are asking: C = your 407 x 36 character matrix r = your row number result = C(r,:); % ro...

casi 8 años hace | 2

| aceptada

Respondida
Problem with a function.
You need to pass s into your perimeter function: p = perimeter(s);

casi 8 años hace | 0

| aceptada

Cargar más