回答済み
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

さらに読み込む