답변 있음
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)...

7년 초과 전 | 0

| 수락됨

답변 있음
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...

7년 초과 전 | 0

답변 있음
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...

7년 초과 전 | 0

| 수락됨

답변 있음
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 ...

7년 초과 전 | 0

| 수락됨

답변 있음
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...

7년 초과 전 | 0

| 수락됨

답변 있음
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;

7년 초과 전 | 0

| 수락됨

답변 있음
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...

7년 초과 전 | 0

답변 있음
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...

7년 초과 전 | 0

답변 있음
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.

7년 초과 전 | 0

답변 있음
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 = [...

7년 초과 전 | 1

답변 있음
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.

7년 초과 전 | 1

답변 있음
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...

7년 초과 전 | 0

답변 있음
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_...

7년 초과 전 | 0

| 수락됨

답변 있음
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...

7년 초과 전 | 1

답변 있음
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...

7년 초과 전 | 1

| 수락됨

답변 있음
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...

7년 초과 전 | 0

| 수락됨

답변 있음
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...

7년 초과 전 | 0

답변 있음
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.

7년 초과 전 | 0

답변 있음
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...

7년 초과 전 | 0

답변 있음
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) = ...

7년 초과 전 | 1

| 수락됨

답변 있음
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...

7년 초과 전 | 0

| 수락됨

답변 있음
Unusual slowdown using sum.
Are you pre-allocating Grandarray?

7년 초과 전 | 0

답변 있음
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...

7년 초과 전 | 1

답변 있음
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...

7년 초과 전 | 0

| 수락됨

답변 있음
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 ...

7년 초과 전 | 0

| 수락됨

답변 있음
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...

7년 초과 전 | 2

| 수락됨

답변 있음
Problem with a function.
You need to pass s into your perimeter function: p = perimeter(s);

7년 초과 전 | 0

| 수락됨

답변 있음
How to output a mexFunction input without copy
If you are returning a modified variable, then you basically have three choices: 1) Do it the way you were previously doing i...

7년 초과 전 | 0

답변 있음
How do I convert this into a 2d matrix of 50x50 in Matlab?
_"... I copied the values from Matlab's command window directly …"_ That means it is a sparse matrix based on the format of ...

7년 초과 전 | 1

| 수락됨

답변 있음
Index exceeds array bounds help - Fibonacci Series
_"... For this reason, since at the end we only need the (N)th and (N-1)th terms, we can delete all the other ones as the loop g...

7년 초과 전 | 0

더 보기