Réponse apportée
Combining Vector in a matrix
A cell array is very useful when you want to combine strings and numerical values into a single matrix. Let's build one: Mo...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
How to cut the end of a string which follows a special character?
Many options, including: str = 'sahdklsjf_sdfs' out1 = str(1:find([str '_']=='_',1,'first')) Also take a look at TEX...

presque 11 ans il y a | 0

Réponse apportée
Plotting 1/x correctly
Your plotting values against their index. And indeed, since x(3) is not equal to 3, but 0.2020, y(3) is not 1/3. You can use pl...

presque 11 ans il y a | 0

A soumis


permnsub(V,N, IX)
Subset of all permutations with repetition

presque 11 ans il y a | 1 téléchargement |

5.0 / 5

Question


Problem running Windows executable using "system"
I have an executable (PROG.exe) that runs perfectly within a cmd-shell in windows 7. However, when I call it from within matlab ...

presque 11 ans il y a | 1 réponse | 0

0

réponse

Réponse apportée
Matlab jokes or puns
MatLab excels Excel while Excel does not matlab MatLab.

presque 11 ans il y a | 137

Réponse apportée
Why when we try to represent a sinus function we use a cosinus expression some times and cosinus another times like the case in matlab?
Both a cosine and a sine are sinusoids, but one is shifted in phase compared to the other cos(x) = sin(x + (pi/2))

presque 11 ans il y a | 1

| A accepté

Réponse apportée
Find a subset of unique permutations
Why not use NCHOOSEK? A = [5 6 2 4 7]; nchoosek(A,3) ans = 5 6 2 5 6 4 ...

presque 11 ans il y a | 2

| A accepté

Réponse apportée
error when sum a vector
Most likely you have declared a *variable* called sum, which now clashes with the *function* sum In your case, you then want ...

presque 11 ans il y a | 2

Réponse apportée
How can I find maximum before a certain element in my matrix
Just for fun, as a one-liner: B = [5 8 5 2 6 9 10]; MaxBeforeMin = max(B(1:find(B==min(B),1,'first')))

presque 11 ans il y a | 1

Réponse apportée
How can I find the maximum element of each column of a cell array
Life would be much easier if you didn't have your data arranges like this in the first place. How did you get this cell array? I...

presque 11 ans il y a | 1

Réponse apportée
how to concatenate vectors
If all elements of T are row or column vectors, you can use VERTCAT or HORZCAT, using comma-separated list expansion: T1 = ...

presque 11 ans il y a | 3

| A accepté

A résolu


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

presque 11 ans il y a

Réponse apportée
Start plot errorbar() at 0 ?
You can change limits of the axis using the commands YLIM CurYLim = ylim % get the current Y limits ylim([0 CurYlim(2)])...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Editing a function to return a value that shows how many times a recursive function is called
You can add a second output argument function [result, CallN] = myFunction(n, CallN) if nargin==1, CallN = 1 ;...

environ 11 ans il y a | 1

Réponse apportée
replace number by string
% conversion rules V(k) corresponds to S(k): V = [ 3 4 6 9 1] ; S = {'AA','B','CCC','D','EEE'} ; Value...

environ 11 ans il y a | 0

Réponse apportée
How to normalize values in a matrix to be between 0 and 1?
This can be simply done in a two step process # subtract the minimum # divide by the new maximum normA = A - min(A(:)) ...

environ 11 ans il y a | 8

| A accepté

Réponse apportée
Hi, guys. How would one extract the lower triangle of a matrix without using the tril function and witout a for loop?
A = rand(5) ; % [c,r] = meshgrid(1:size(A,1),1:size(A,2)) trilA = A ; trilA(c>r) = 0 diagA = A ; d...

environ 11 ans il y a | 0

Réponse apportée
Count amount of 0's and 1's in an array
Since the array is always an alternation of zeros and ones N = diff([0 find(diff(A)) numel(A)]) will produce the runs of...

environ 11 ans il y a | 1

Réponse apportée
I need help with fixing the error in my for loop equation
You want to put the formula for H out of the loop for .. % ask for values here end % summing formula here

environ 11 ans il y a | 0

Réponse apportée
Fibonacci program makes matlab go busy forever
The Nth matrix power of the square matrix [1 1 ; 1 0] will give you three Fibonacci numbers at once, namely the (N+1)-th, the N-...

environ 11 ans il y a | 5

Réponse apportée
how to make string vector?
You realise that, in ML, ['18','29'] is exactly the same as the single character array '1829' ? a = [18, 29] str = sprin...

environ 11 ans il y a | 1

Réponse apportée
how to find nearest values of all elements of a matrix to another matrix in matlab
Take a look at *NEARESTPOINT* as this function does *exactly* what you want and is pretty damn fast, if I say so myself :-) <...

environ 11 ans il y a | 1

Réponse apportée
How can I insert missing rows in a matrix
This is not really trivial. Here is one approach: x=[1 4; 4 6;2 3;3 2;4 2;1 3] Data = x(:,2) ; SerialNumber = x(:,1) ...

environ 11 ans il y a | 0

| A accepté

Réponse apportée
Reading and separating data
My approach would be: 1) read in all the lines of the text file as strings using ';' as a delimiter C = textread('myfile...

environ 11 ans il y a | 0

Réponse apportée
How Can I Make a Matlab Code generate multiple separate matrices
To generate one 4-by-4 matrix with a specific value you can use various approaches Value = 3 ; A = repmat(Value,4,4) ...

environ 11 ans il y a | 1

Réponse apportée
how to find nearest values of all elements of a matrix to another matrix in matlab
A = [1 5 7 3 2 8] B = [4 12 11 10 9 23 1 15] TMP = bsxfun(@(x,y) abs(x-y), A(:), reshape(B,1,[])) [D, idxB] = min...

environ 11 ans il y a | 1

| A accepté

Réponse apportée
How to convert Hex data into decimal data?
Hexadecimal values are stored in strings in MatLab. HexValue = 'FE' hex2dec = hex2dec(HexValue) DataHex = {'B5','C...

environ 11 ans il y a | 2

| A accepté

Réponse apportée
What is Arithmetic mean filter ?
The arithmetic mean is the mathematical term for the "mean", i.e., the sum of the elements divided by the number of elements. ...

environ 11 ans il y a | 0

| A accepté

Réponse apportée
Replace String with a NaN in table
Take a look at CELL2FLOAT <http://www.mathworks.com/matlabcentral/fileexchange/19730-cell2float>

environ 11 ans il y a | 1

Charger plus