답변 있음
Problems with cell array
min(cat(2,c{1:size(c,1)+1:end}),[],2)

대략 11년 전 | 0

답변 있음
How do I copy fields name and their contents to another struct variable?
a(1).x = 1 a(2).x = 2 a(3).x = 3 b(1:2) = a(2:3) % Is this what you want? b(1) now equals a(2) ...

대략 11년 전 | 1

답변 있음
how to access data from cell array within another cell array
I have trouble recreating your data: C = {{1 2 3}{10 11}} gives me a 1x2 cell array with cells as elements: % C = ...

대략 11년 전 | 1

| 수락됨

답변 있음
i am facing problems using the helpdlg() command
You can put the strings into a cell array of strings, like this: helpdlg({'Line 1', 'Line 2 is followed by an empty line', ...

대략 11년 전 | 0

| 수락됨

답변 있음
Finding smallest value in nested structure
I think the for-loop approach is the best option. You can use that to store each value in a matrix first: Ni = numel(subj...

대략 11년 전 | 0

답변 있음
How to combine numerical values into one?
Use the power of ARRAYFUN: a = [0 1 1] b = [1 0 1] c = arrayfun(@(k) sprintf('%d%d',a(k),b(k)),1:numel(a...

대략 11년 전 | 0

답변 있음
graph of y = 1 / ( cos(x) -c)
I think these lines do not behave as expected: C = cos(x0) - (1./y0); % these values are never used for C= 1:7 y = 1....

대략 11년 전 | 0

답변 있음
Array Building using Dynamic Field Reference using an Array of Strings
Something along these lines? Data.Field1=[1; 2; 3] Data.Field2=[4; 5; 6] C = struct2cell(Data) Output = cat(2,C...

대략 11년 전 | 0

| 수락됨

답변 있음
how to fix the warning message with polyfit?
Are you sure you want to fit your data with a polynomial of degree that scales with the number of elements of X? Moreover, is a...

대략 11년 전 | 0

답변 있음
Returning last value of while loop
You can return multiple outputs with functions function [q, k] = myimproperintegral(f,a,b,tol) ...

대략 11년 전 | 0

답변 있음
Changing the step in a for loop
For-loops in matlab behave a little different than for loops in C. You might be in need of a While-loop. for k=1:5 di...

대략 11년 전 | 0

제출됨


fourplot(X)
Four-plot for efficient visual exploratory data analysis, with box plot (V3.0, feb 2015)

대략 11년 전 | 다운로드 수: 1 |

3.0 / 5
Thumbnail

답변 있음
How do I set a certain duration for a stimuli presentation?
I suggest you do not use delete and pause. Here is an alternative x = [1 2 6 8 3] ; y = [7 1 3 9 6] ; sti...

대략 11년 전 | 3

답변 있음
I want to break my sample like this. Problem with my logic. need help
data = 'GAATGCT' N = 4 ; for k= 1:numel(data)-N subsample = data(k:k+N) ; disp(subsample) end

대략 11년 전 | 0

| 수락됨

답변 있음
i want to make random size of my datasample.output must give random size array. As i am very new in matlab. please help.
you want a random size sample? Like this, perhaps: DATA = 'ATCG' K = randi([10 20],1) % random number between 10 and 20...

대략 11년 전 | 0

답변 있음
stretching a non-monotonically increasing vector
You do want to take a look at interp1 t = [1 3 4 6 9] ; % irregular time intervals y = [0 1 1 0 1] ; t1 = 1:9 ; %...

대략 11년 전 | 0

답변 있음
Split a matrix in two matrix according a criterion
% sample data G = {'wt','wt','ko','ko','wt'} V = [10 20 30 40 50] % transform G into numbers, there are other way...

대략 11년 전 | 0

답변 있음
I want to add a 20 by 20 matrix to a 50 by 50 matrix ? the resuting matrix should be of 50 by 50 .
For arbitrary sized 2D matrices A and B: % example data A = ones(3,5) B = 2*ones(4,2) % engine szA = si...

대략 11년 전 | 0

답변 있음
character to variable that already exists in the workspace
You should store your data into structs or in cell arrays: scoreStruct(1).values = [1 2 3] scoreStruct(2).values = 10 ...

대략 11년 전 | 1

답변 있음
Add title to current axes
set(get(gca, 'title'), 'string', 'My First Title')

대략 11년 전 | 0

| 수락됨

답변 있음
How to arrange rows of a matrix to get a specific column in order?
Yes, there is! Take a look at SORTROWS M = [1 2 3 ; 2 3 1 ; 3 1 2] sortrows(M,2)

대략 11년 전 | 1

답변 있음
Central part of a matrix
Something like this? M = spiral(10) % test matrix S = 2 % s elements around the central position % the resulting mat...

대략 11년 전 | 1

답변 있음
How to mix order of rows in a matrix?
Very much the same procedure; M = repmat(1:10,4,1).' % example data r = randperm(size(M,1)) % permute row numbers M...

대략 11년 전 | 1

| 수락됨

답변 있음
Storing all values into an array
You want to do something like this: N = 10 ; A = zeros(N,1) ; % pre-allocation, will speeds things up for k=1:N, ...

대략 11년 전 | 0

| 수락됨

답변 있음
Selecting a random number with some probability
For two values it is simple VAL = [10 20] % 2 values P = .8 % probabbility of selecting first value Ndraw ...

대략 11년 전 | 1

답변 있음
Find a value with cell array.
No need for cell2mat, simple concatenation would do: val = [A{:,1}] tf = val == 7 out = A(tf,2) which you can do a...

대략 11년 전 | 1

| 수락됨

답변 있음
if else elseif and other conditions
Seems fine to me. Did you try?

대략 11년 전 | 1

| 수락됨

답변 있음
Plotting a circel using fill funtion
You might also be interested in learning about the function rectangle, as in: rectangle('curv',[1 1],'position',[0 0 1 1],'...

대략 11년 전 | 0

답변 있음
How to vectorize assignment of a structure's field value
More matlab-y, but completely gibberish for the non-native matlab speaker: A = 10:10:50 C = num2cell(A) [objects(1:nu...

대략 11년 전 | 0

답변 있음
how to choose matrix columns randomly?
Exactly 80 vs 20? Or in approximation? And how many columns? I also assume the number of rows in A and B are the same. A sug...

대략 11년 전 | 0

더 보기