답변 있음
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 = ...

거의 12년 전 | 0

답변 있음
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 ...

거의 12년 전 | 0

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

거의 12년 전 | 16

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

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 0

| 수락됨

답변 있음
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 ...

거의 12년 전 | 1

| 수락됨

답변 있음
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...

거의 12년 전 | 1

| 수락됨

답변 있음
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...

거의 12년 전 | 0

답변 있음
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) % ...

거의 12년 전 | 1

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

거의 12년 전 | 0

| 수락됨

답변 있음
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) ...

거의 12년 전 | 0

답변 있음
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 ...

거의 12년 전 | 0

| 수락됨

답변 있음
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...

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 0

| 수락됨

답변 있음
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)

거의 12년 전 | 2

답변 있음
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 ...

거의 12년 전 | 0

| 수락됨

답변 있음
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...

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 0

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

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 0

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

거의 12년 전 | 0

답변 있음
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 = ...

거의 12년 전 | 0

답변 있음
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 ...

거의 12년 전 | 0

답변 있음
Removing the integral part of number from a matrix
A - fix(A)

거의 12년 전 | 0

| 수락됨

답변 있음
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...

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 5

| 수락됨

답변 있음
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...

거의 12년 전 | 0

답변 있음
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...

거의 12년 전 | 0

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

거의 12년 전 | 0

더 보기