Réponse apportée
issue when creating a long vector
You can scale the values before you use interp1. Something along these lines: xi = 1:60e5; x_scaled = x * 1e5 ; yi = ...

environ 12 ans il y a | 0

Réponse apportée
name of variables from a cell of strings
*Do not do this!* Use structs b={'alpha', 'beta', 'gamma'} x.(b{1}) = 1:3 x.(b{2}) = 'hello' x.(b{3}) = NaN ...

environ 12 ans il y a | 0

Réponse apportée
finding repetition numbers in array.
Your question title (finding repetition numbers) and your question text ("how many times exist") are open for ambiguity. For ...

environ 12 ans il y a | 16

Réponse apportée
How to merge cells together?
Another option using STRCAT A = {'apple.doc', 'apple.xlsx', 'apple.csv', 'banana.doc', 'banana.xlsx'} B = strcat(A,';') ...

environ 12 ans il y a | 0

Réponse apportée
How to compute regions of matrix
Trivial, provided you have the image processing toolbox. Take a look at BWLABEL and REGIONPROPS M = [ 0 0 0 0 0 0 0...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
cellarray which contains different types of data
A = {'text', 1000, 2000, 'data'} A_as_strings = cellfun(@num2str, A, 'un', 0) and then you can use ismember ...

environ 12 ans il y a | 1

| A accepté

Réponse apportée
Repeative selecting unique values of matrix
Here is a working algorithm M = [2 3 8 1 4 7 6 5 9 ; 1 3 8 9 4 6 5 2 7 ; 2 8 1 4 6 3 9 5 7] P = ze...

environ 12 ans il y a | 1

| A accepté

Réponse apportée
Problem regarding to change conversion of cell2mat.
This is a case for PADCAT: my_cell={[1,10],[1,2,10],[1,6,10]} result = padcat(my_cell{:}) PADCAT can be downloaded fr...

environ 12 ans il y a | 0

Réponse apportée
How do I compare two sets of numerical strings character by character on Matlab ?
a = '1011101' b = '1011000' q = a~=b % a logical array, true for locations where a and b differ n = nnz(q) % ...

environ 12 ans il y a | 1

Réponse apportée
Switch from one case to another?
use functions, for instance, implemented as sub-functions in your main function. Like this, perhaps: function MainFunctio...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
arrayfun with different dimensions
So you want 20 sums in total (5 values of x combined with 4 values of y)? x = 1:5 y = 1:4 [XX,YY] = ndgrid(x,y) ...

environ 12 ans il y a | 0

Réponse apportée
arrayfun with different dimensions
_factorial(1:k)_ will give you a vector with k values while _factorial(1:k-1)_ will a vector with k-1 values. You simply cannot ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
What does the ~ and | mean in the following code?
take a look at this example A = 1:10 q = A < 4 p = A < 7 np = ~p r = q | np B = A(r) help not help...

environ 12 ans il y a | 0

Réponse apportée
How to finish this function?
Since you may assume that the numbers in the vector are unique you can sum up all numbers (using SUM), subtract the smallest and...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
How to write a function to delete the duplicated arrays?
A = [1 2 2 2 3 1 1] tf = [true diff(A)~=0] B = A(tf)

environ 12 ans il y a | 2

Réponse apportée
Plotting a sum with a variable
Creat a function and use arrayfun: fh = @(k) sum(factorial(k) ./ factorial(1:k) .* factorial(k-(1:k))) % function handle ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
find similar element in a matrix
As for your first question, take a look at my PADCAT function on the File Exchange as it does exactly what you want. <http://ww...

environ 12 ans il y a | 0

Réponse apportée
problem for creating vector with for loop
Many roads to Rome: A = {'w' 'c' 'e'} n = 2 AA1 = A(kron(1:numel(A),ones(1,n))) AA2 = reshape(repma...

environ 12 ans il y a | 0

Réponse apportée
Can someone help me with my code? with an example
Write a function like this function CK = convertFahrenheit (F) % CONVERTFAHRENHEIT - converts temperature % % CK ...

environ 12 ans il y a | 0

Réponse apportée
std for a growing data range
Here is the completely vectored code for the running sample standard deviation across the rows of a matrix X: X = ceil(10*r...

environ 12 ans il y a | 0

Réponse apportée
How can I convert a numeric matrix(a) to a 0 and 1 matrix(b)?
No need for for-loops. This shows the power of linear indexing: a = [3 1 4 2] % these specify column indices b = zer...

environ 12 ans il y a | 0

Réponse apportée
Matrix from a for FOR loop with IF conditioning
n = size(A,1) ... B(i,:) = x ...

environ 12 ans il y a | 0

Réponse apportée
how to find a string within a filename?
NAMES = {'apple.doc', 'apple2.csv', 'TESTappleTEST.xls', 'banana.doc', 'banana2.csv', 'banana3.xls','APPL_almost.txt'} C = ...

environ 12 ans il y a | 0

Réponse apportée
How to create a vector in which numbers increase at first, then remain constant, then reduce back to 1 ?
If N is your fixed length and M is the maximum number (-> (1 2 … M-1 M M M M-1 … 2 1"), here is a simply code: N = 20 , M ...

environ 12 ans il y a | 0

Réponse apportée
Removing the integral part of number from a matrix
A - fix(A)

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Replace bad data in a 24x45x65 matrix. zeroes and values greater than 10 etc..
What you are after is called outlier analysis. What do with recordings that are "bad" or out of range. Simply replacing them wit...

environ 12 ans il y a | 0

Réponse apportée
input equation from user
str = input('Give an equation in x: ','s') ; % the user types in, for instance 2*x^2-3*x+4 x = input('Type in a valu...

environ 12 ans il y a | 5

| A accepté

Réponse apportée
replace multiple "1" with only one "1"
Why not operate on the string array and then convert it to ascii? Like this: FF1 = 'eE_?@ wwqy W' FF3 = double(reg...

environ 12 ans il y a | 0

Réponse apportée
Please explain the following code
This codes reads in a file, shows messages in the command window, makes a plot, calls a few sub functions that perform a lot of...

environ 12 ans il y a | 0

Réponse apportée
How to separate an image to rgb?
Is your image a RGB image with 3 dimensions? RedValues = MyImage(:,:,1) ...

environ 12 ans il y a | 0

Charger plus