Respondida
Mex file crashes matlab but then after I continue gives expected output
Mex files that crash MATLAB usually have bugs in them, likely memory related. Something in MATLAB memory got corrupted. It is ...

más de 10 años hace | 0

| aceptada

Respondida
Solving ODE system on matlab
Your plot3 only picks off three points to plot ... it does not plot all of the results. Also, your model derivative function se...

más de 10 años hace | 0

Respondida
How can I correct a rounding error??
Welcome to the world of floating point arithmetic. See this post: http://www.mathworks.com/matlabcentral/answers/69-why-does-...

más de 10 años hace | 0

Respondida
Which computer programming language are MATLAB R2015b and R2016b written in?
Java for the interface, C++ for computational library stuff, and some 3rd party libraries for some of the matrix algebra BLAS an...

más de 10 años hace | 5

Respondida
How to invert the function typecast?
Don't open the file as a text file with 'wt'. Instead, open it as binary by leaving off the 't' part. E.g., fid = fopen('as...

más de 10 años hace | 0

| aceptada

Respondida
How do I incorporate the structure array into the while loop? I need help ASAP! TYIA.
Look at your first two lines: n=1; while n>1 Since n>1 is not true, you will never get into that while loop and nothi...

más de 10 años hace | 0

| aceptada

Respondida
4th order Runge-Kutta Method Help
You never set the z2 elements inside your loop, so on the second iteration when z2(i-1) is used (with i=3) z2(2) does not exist....

más de 10 años hace | 0

| aceptada

Respondida
Access elements of sparse matrix without find()
If you store this matrix as sparse, then yes the (1,1) 0 element will not be physically stored and cannot be recovered with find...

más de 10 años hace | 0

| aceptada

Respondida
convert struct field in cell array
Do you mean like this: for k=1:numel(result.objList) result.objList(k).objectClass = result.objList(k).objectClass.o...

más de 10 años hace | 0

Respondida
Comparing strings, case insensitive, without str functions
Do you know how to compare, in a case insensitive way, whether two characters are equal or not? Once you can do that, just put i...

más de 10 años hace | 0

| aceptada

Respondida
Generate a bit stream of 1s and 0s in Matlab, the bit stream should have a uniform random distribution. The bit stream should have a length N=100000.
You didn't ask a question. But looking at your code, did you mean to use bit_stream instead of stream? E.g., stem(bit_str...

más de 10 años hace | 0

| aceptada

Respondida
Why isn't my code working?
You need to enclose the denominator in parentheses: Q1=(-b-sqrt(b^2-4*a*c))/(2*a); The way you have it coded, since / an...

más de 10 años hace | 1

Respondida
For loop isn't working, unsure as to why
I think you meant for this to be a double for loop. As coded, you only have one for loop and j is a vector. E.g., is this what ...

más de 10 años hace | 1

| aceptada

Respondida
Whats wrong with my quadratic formula?
You need to enclose the denominator in parentheses: Q1=(-b-sqrt(b^2-4*a*c))/(2*a); The way you have it coded, since / an...

más de 10 años hace | 0

| aceptada

Respondida
Can I pre-set save-filename, just like in C?
Do you mean something like this? datafile = '01.dat'; AA = ['output_' datafile]; % <-- Concatenate your root name with ...

más de 10 años hace | 0

| aceptada

Respondida
Passing a string variable between my c++ code to matlab
First, once you are done using the mxArray variables, destroy them. E.g., at the end of your code do this: mxDestroyArray(...

más de 10 años hace | 1

| aceptada

Respondida
Remove certain elements from a matrix
Replace this: % Remove points where there are zeros for i = 1:length(OldData) if(OldData(i,2) == 0) ...

más de 10 años hace | 0

Respondida
Matrix sorting, smallest to biggest
After your loop, add this line: a = a'; The reason you are getting the result column-ordered instead of row-ordered is b...

más de 10 años hace | 0

Respondida
Want to get only characters after using bin2dec.
If you are shuffling the bits around, then you are likely getting resulting characters that are in the "non-printable" set ... i...

más de 10 años hace | 1

Respondida
Matlab code help on Euler's Method
Here is a general outline for Euler's Method: % Euler's Method % Initial conditions and setup h = (enter your step si...

más de 10 años hace | 12

| aceptada

Respondida
Marking pixels above a certain value
Hint for the 1st part, G = (insert code here to pick off the green plane) mark_green = G >= 0.5; % the marked pixels ...

más de 10 años hace | 1

| aceptada

Respondida
Write a user defined function psum to approximate the value of the sum
Here is a start. It's a basic outline of the summing code with only a couple of lines for you to fill in. You will also need to...

más de 10 años hace | 0

Respondida
Modeling the radio-active decay using ode23
For starters, you have t and x reversed in the argument list of the derivative function f1. Also, it seems to me that the rate ...

más de 10 años hace | 0

| aceptada

Respondida
Matrix of structures/matrix of column vectors
Using cell arrays: combi = cell(m,n); for k=1:m*n combi{k} = [R(k);G(k);B(k)]; end Then you can get at each...

más de 10 años hace | 1

| aceptada

Respondida
Euler Method on without ODE
When calling a function file, MATLAB calls it based on the *filename*, not the function name listed on the function line in the ...

más de 10 años hace | 0

Respondida
how to calculate all permutations of ['a' 'b' 'c' ... 'x' 'y' 'z'] just 26 characters, yet combinator.m combinations.m return errors
"... does any one know how can i, even if only one by one, go through all permutations of ..." I could post code to do this, ...

más de 10 años hace | 2

Respondida
sum() fails while operating on a large array of single floats
My guess is this is caused by using single precision accumulators for the sums at the low level code. If you were to write a si...

más de 10 años hace | 2

| aceptada

Respondida
Criss-cross indexing of array elements
Try this using linear indexing as you suggested: z = size(A); mn = z(1) * z(2); x = (1:mn)' + (B(:)-1)*mn; C ...

más de 10 años hace | 0

| aceptada

Respondida
Error using plot Conversion to double from function_handle is not possible.
y is a function_handle, so you have to pass it some data. plot(x,y(x)) What you did was basically equivalent to this: ...

más de 10 años hace | 1

| aceptada

Cargar más