Respondida
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 = ...

alrededor de 12 años hace | 0

Respondida
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 ...

alrededor de 12 años hace | 0

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

alrededor de 12 años hace | 16

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

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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 ...

alrededor de 12 años hace | 1

| aceptada

Respondida
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...

alrededor de 12 años hace | 1

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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) % ...

alrededor de 12 años hace | 1

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

alrededor de 12 años hace | 0

| aceptada

Respondida
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) ...

alrededor de 12 años hace | 0

Respondida
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 ...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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)

alrededor de 12 años hace | 2

Respondida
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 ...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

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

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
Matrix from a for FOR loop with IF conditioning
n = size(A,1) ... B(i,:) = x ...

más de 12 años hace | 0

Respondida
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 = ...

más de 12 años hace | 0

Respondida
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 ...

más de 12 años hace | 0

Respondida
Removing the integral part of number from a matrix
A - fix(A)

más de 12 años hace | 0

| aceptada

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 5

| aceptada

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
How to separate an image to rgb?
Is your image a RGB image with 3 dimensions? RedValues = MyImage(:,:,1) ...

más de 12 años hace | 0

Cargar más