Respondida
How do I solve Kepler's equation for E using fzero?
To use fzero, you first need to form an equation with 0 on one side. So this equation: M = E - e * sin(E) becomes this e...

casi 9 años hace | 0

| aceptada

Respondida
How to write a script to determine whether or not a given year is a leap-year
You are not applying the tests in the proper order. From this link: https://en.wikipedia.org/wiki/Leap_year Look at the A...

casi 9 años hace | 1

| aceptada

Respondida
Create a 4D matrix with specific range values
Here is one way to do what you have asked, although I don't really know if this is the best way to go about coding the real prob...

casi 9 años hace | 0

Respondida
3d matrix multiplication with reduce computation time
Some testing issues I had: I couldn't run the posted code because npolinomi was not defined. Looking at the code, I made a g...

casi 9 años hace | 0

| aceptada

Respondida
Is there anybody to help me fix the error and convert mxArray to double?
What happens if you add this prior to the "care" call: G0 = zeros(1,4);

casi 9 años hace | 1

| aceptada

Respondida
Swapping the elements in a matrix
You've got hard-coded row numbers and matrix sizes in your code. Rather than doing that, along with all of the copy-pasting you...

casi 9 años hace | 0

| aceptada

Respondida
How to delete a substring within a string
Assuming the cells to be deleted are all of the form {''}, you could simply use the isequal function. E.g. x = cellfun(@(y)...

casi 9 años hace | 1

| aceptada

Respondida
How to shrink a pre-allocated array in a C-Mex?
I am unaware of specific documentation on this, but Part 1 should be sufficient (and safe) as long as you don't care about the w...

casi 9 años hace | 1

| aceptada

Respondida
can anybody help me to solve my problem with mex instruction of "mld4bmf" library ?
You need to edit the matlabasso.c source file and replace the call to mxErrMsgTxt with mexErrMsgTxt.

casi 9 años hace | 0

| aceptada

Respondida
C++ to 64-bit MEX
Start here: https://www.mathworks.com/help/matlab/call-mex-files-1.html

casi 9 años hace | 0

Respondida
How can i print the value of a variable in the text that is to be displayed while asking for an input?
E.g. x = input(sprintf('Enter the value of %dth variable ',i)) or x = input(['Enter the value of ' num2str(i) 'th ...

casi 9 años hace | 0

| aceptada

Respondida
How to filter out multiple rows based on another array?
result = a(ismember(a,b));

casi 9 años hace | 0

| aceptada

Respondida
Matlab provides different results for same formula
Is this just an index typo? You state 429,79 in your text, but the code has index 425,79. Also, the calculation in the loop ...

casi 9 años hace | 3

| aceptada

Respondida
Expanding a Matrix with Repmat/Reshape?
E.g., z = cell2mat(cellfun(@(x,y)repmat(x,1,y),num2cell(x),num2cell(y),'Uni',false)); But this just hides the loops in t...

casi 9 años hace | 0

| aceptada

Respondida
Read and access MAT file data in C
This: const int *dim_array; should probably be this const mwSize *dim_array; Also, this mxArray ***p; sh...

casi 9 años hace | 1

| aceptada

Respondida
Error using mex (mxErrMsgTxt)
Source code typo. The function name is mexErrMsgTxt, not mxErrMsgTxt.

casi 9 años hace | 3

| aceptada

Respondida
How to solve the varying length of strings of double pendulum in the simulation?
Do you have a profile of how the string lengths change as a function of time? E.g., can you do something like this: Have fun...

alrededor de 9 años hace | 0

Respondida
Return Matrix to Original Order
Keep track of the original indexing. E.g., >> RPM_c = randperm(15) % sample data RPM_c = 10 9 15 6 ...

alrededor de 9 años hace | 3

| aceptada

Respondida
Manipulating strings defined with the new double quote option
extractBetween(s1,2,4)

alrededor de 9 años hace | 2

Enviada


LOADFIXNAMES loads a mat file, fixing invalid names
Loads a mat file into the caller's workspace, fixing invalid variable and field names.

alrededor de 9 años hace | 1 descarga |

5.0 / 5
Thumbnail

Respondida
Non-repeating random integer generator with a seed
According to the doc for randperm, it uses the same random number generator as rand, randi, and randn. So you can control the s...

alrededor de 9 años hace | 0

| aceptada

Respondida
Finding matrix column index based on certain conditions
result = find(sum(A==1)==1 & sum(A==0)==(size(A,1)-1));

alrededor de 9 años hace | 0

| aceptada

Respondida
writing in other languages(C,python,...)
You can use the MATLAB editor to write C/C++ code. It is language sensitive. You cannot use C/C++ (or .h) files directly fro...

alrededor de 9 años hace | 2

Respondida
how to change specific factor in a matrix
For the general case of changing numbers, you could do this: X = your array result_index = [4 1 6 5 3 2]; % 1 to 4, 2 ...

alrededor de 9 años hace | 0

| aceptada

Respondida
Cell contents reference from a non-cell array object, why?
As written, X0_r is a cell array, but the elements of this cell array are NULL (empty) since nothing has been put into it yet. S...

alrededor de 9 años hace | 0

Respondida
A line of my code is T4=(T3.*T1)./T2 where T2 is a 1x10 double matrix and T3 is a 1x6double matrix. How can I reshape one of the matrices so that the line of code works enabling me to get values of T4. T1 is a 1x1 double.
E.g., to get all combinations of the elements: AT4 = bsxfun(@rdivide,AT3.*T1,T2A(:)); Or in R2016b or later AT4 = A...

alrededor de 9 años hace | 1

| aceptada

Respondida
Multiple inputs into for loop
E.g., to vary them at the same time numPixelSpinefromPhan = [2688.00 3619.00 4306.00 4009.00 5029.00 5224.00 4151.00 2518.0...

alrededor de 9 años hace | 0

| aceptada

Respondida
Multiply each column in MxN matrix with it's transpose to create MxMxN matrix
X = your MxN matrix [M,N] = size(X); Xcols = reshape(X,M,1,N); Xrows = reshape(X,1,M,N); result = bsxfun(@times,Xc...

alrededor de 9 años hace | 0

Respondida
i am being asked to solve a problem by eulers method
See Euler's Method here: https://en.wikipedia.org/wiki/Euler_method Look at the examples. An outline to get you going on ...

alrededor de 9 años hace | 0

Respondida
how can I increment 2 variables in a for loop at the same time?
There are several ways to achieve this. E.g., I = some range J = some range for k=1:numel(I) i = I(k); ...

alrededor de 9 años hace | 4

| aceptada

Cargar más