Community Profile

photo

Stephen Cobeldick


5,337 2014 年以降の合計貢献数

Suspensa Vix Via Fit

Stephen Cobeldick's バッジ

  • Master
  • 36 Month Streak
  • Thankful Level 4
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

詳細を表示...

貢献した分野
表示方法

回答済み
what does the L-shaped bracket mean?
Those brackets are actually the common way in mathematics to represent the floor function: https://www.mathsisfun.com/sets/func...

約15時間 前 | 1

回答済み
Matrix element changing with loop
5 is a scalar. A scalar has size 1x1. On the second loop iteration a has size Nx2 (we don't know the actual size because you di...

約16時間 前 | 0

回答済み
how do you check that a value input into your code is exactly 7 digits long before proceeding?
idNumber = '1234567'; assert(numel(idNumber)==7,'Wrong length ID number')

1日 前 | 0

回答済み
Change colour order and restore it
set(gca,'ColorOrder',co) and remember that you have to change the ColorOrder before plotting the data.

1日 前 | 0

回答済み
How can I generate an array of binary data of this form?
It might not be the most beautiful algorithm in the world, but this works (on 64 bit MATLAB) for even N values up to at least N...

1日 前 | 0

回答済み
Conditional function creating with @ handle
Directly for this specific calculation: >> f = @(x,y) x + y*(1-2*((x*y)<=1)); >> f(1,2) ans = 3 >> f(2,1) ans = 3 It wor...

2日 前 | 1

| 採用済み

回答済み
Passing data through fminsearch
You should definitely avoid global variables. For your situation the easiest way to parameterize a function is to use a simple ...

3日 前 | 0

回答済み
Any suggestion on how to solve this problem using Matlab?
I know this is homework, but someone needs to show that it is a waste time writing loops, it is much better to write simple vect...

3日 前 | 0

回答済み
Duplicate every element of a matrix to NxN elements
>> M = [1,2;3,4]; >> kron(M,[1,1;1,1]) ans = 1 1 2 2 1 1 2 2 3 3 4 4 3 3 4 4

3日 前 | 0

| 採用済み

回答済み
accumarray does not return the correct sum
Your data: hdr = {'Date','ID','x','y','z','Profit'}; arr = {... '01-Jan-2019' 157350 0 1 100 0.470000000000000 '01-Jan-2019'...

4日 前 | 1

回答済み
Strange behavior of the editor in the forum
Unfortunately the new editor does not work with Windows high-contrast mode, most of the toolbar buttons end up totally blank: ...

4日 前 | 0

回答済み
Experts of MATLAB, how did you learn? Any advice for beginner/intermediate users?
I reject the label "expert", but here is my two cents worth anyway: MATLAB Specific: MATLAB has a great feature that very few ...

4日 前 | 50

| 採用済み

回答済み
where (what package) is the Matlab's wvd function?
Signal Processing Toolbox. You can easily find this out yourself using the online help, simply finding that page using your fav...

5日 前 | 0

回答済み
Using cellfun() to set cell array of graphic objects 'Visible' Property to 'off'
You will need to define an anonymous function like this: cellfun(@(g)set(g,'Visible','off'),your_cell_array_of_handles) Note t...

5日 前 | 2

| 採用済み

回答済み
Create function handle with several variables/arguments
Why not just vectorize the multiplication and summation?: fun = @(z) sum(cv(:).*z(:)); https://www.mathworks.com/help/matlab/m...

5日 前 | 2

| 採用済み

回答済み
How to concentrate matrix 100 times?
Your approach is entirely in the wrong direction: using numbered variables is a sign that you are doing something wrong with you...

6日 前 | 0

| 採用済み

回答済み
How to use the prctile (X,p,'all') function?
According to the MATLAB documentation the 'all' option was added in version R2018b: https://www.mathworks.com/help/stats/releas...

6日 前 | 1

回答済み
Using the matlab to achieve the a(k)+a(j) when k is not equal to j in every stage
a = [1,2,3,4]; for k = 1:4 b = 0; for j = 1:4 if j~=k b = b + a(k) + a(j); en...

6日 前 | 0

| 採用済み

回答済み
Sum columns of matrix
>> M = [1,5,2,4,3,2;2,3,1,4,4,1;4,5,2,2,3,1] M = 1 5 2 4 3 2 2 3 1 4 4 1 4 5 2 2 3 1 ...

7日 前 | 0

| 採用済み

回答済み
How to split a [30x250x1000] array into 1,000-2D matrices
Just use a simple cell array: function epoch = matrix_extractor(data_class,number_epochs) data_class; C = cell(1,numb...

7日 前 | 1

| 採用済み

回答済み
Too many input arguments
Everywhere you call function HionpH you call it with two input arguments, but you defined the actual function with just one inpu...

7日 前 | 1

| 採用済み

回答済み
Using fprintf to create a table of values
Remember that MATLAB is column-major, so it works down the columns first. Pay careful attention to the orientation of the vector...

8日 前 | 0

回答済み
How to vectorize double sum
>> N = 4; >> x = randi(9,3,N) x = 5 4 8 9 2 9 9 8 1 1 4 1 >> F = @(c)bsxfun(@minus,x(:,c),x(:,c...

8日 前 | 1

| 採用済み

回答済み
Increment dates using for loop
>> D = datetime('01-Jan-2018'); >> N = 14; >> G = 3; >> V = D + caldays(0:ceil(N/G)-1).'; >> V = repelem(V,G); >> V = V(1:N...

8日 前 | 0

回答済み
comparing columns of cell arrays
As most of the data seem to be numeric encoded as character vectors, then we can easily convert them from char to numeric arrays...

9日 前 | 0

| 採用済み

回答済み
How can I do matrix indexing
A simple and reliable solution using linear indexing: >> f = [1,22,333;4,33,111;1,4,33] f = 1 22 333 4 33 ...

9日 前 | 0

| 採用済み

回答済み
Is there a product function that works in the same way as diff?
"...but instead of difference gives me the product of every other element?" It is not clear what you mean by "every other eleme...

9日 前 | 0

| 採用済み

回答済み
How to compare each element of a matrix with a number? And then star it out
>> V = 1:7; >> N = 6; >> C = cellstr(num2str(V(:))) >> X = V>=N; >> C(X) = strcat(C(X),'*') C = '1' '2' '3'...

9日 前 | 1

回答済み
How to get the difference between two numbers in a matrix?
>> A = [20,40;30,60;25,50;10,70] A = 20 40 30 60 25 50 10 70 >> N = size(A,1); >> V = 1:N-1; >> F = ...

9日 前 | 0

| 採用済み

回答済み
How to obtain ORIGINAL columnar indexes of top 3% values.
mat = [1,3,5;1,23,9;123,34,75]; idy = 1:ceil(size(mat,1)*0.03); for k = 1:size(mat,2) [vec,idx] = sort(mat(:,k),'descend'...

9日 前 | 0

Load more