Community Profile

photo

Stephen Cobeldick


4,112 total contributions since 2014

Suspensa Vix Via Fit

Stephen Cobeldick's Badges

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

View details...

Contributions in
View by

Answered
Please Help me about matlab code
The problem is how you are calling the function. |quantilereg| is a function that requires three input arguments: quantiler...

12 hours ago | 0

Answered
creating a list of strings with different numbers and same letters
This is easy using <https://www.mathworks.com/help/matlab/ref/sprintf.html |sprintf|>: D = 'MyFolder'; for kk = 0:100 ...

12 hours ago | 0

| accepted

Answered
multiple interp1 without loop
Try using a loop with <https://www.mathworks.com/help/matlab/ref/interp1q.html |interp1q|>.

12 hours ago | 0

Answered
Time Stamp is a Large Number
Use either <https://www.mathworks.com/help/matlab/ref/readtable.html |readtable|> or <https://www.mathworks.com/help/matlab/ref/...

13 hours ago | 0

Answered
How to extract only floating numbers from a string
>> S = '21.5VgDC_0.05000V_VgAC_50M-150M30ms47GV1'; >> C = regexp(S,'\d+\.?\d*','match'); >> C{:} ans = 21.5 ans = ...

15 hours ago | 0

Answered
How to number permutation values in "for" loop to be sequentially printed as 1, 2, 3 etc?
cnt = 0; for ii = 1:3 for jj = 1:3 for kk = 1:3 cnt = cnt+1 ... ...

15 hours ago | 1

| accepted

Answered
How to use two colormaps (of different size) in same figure with one axes?
I think the easiest solution would be to use two axes, and stack the quiver axes on top of the map axes (both of these are done ...

18 hours ago | 1

Answered
Concatenate vectors in cell array { } or matrix [ ] with coordinates
A(2:3,2) = {4;5} And for a numeric/char/logical/...: M(2:3,2) = [4;5]

1 day ago | 0

| accepted

Answered
min/max indexing of array
Using a logical comparison is much simpler: >> E(bsxfun(@ne,E,min(E,[],3))) = NaN E = ans(:,:,1) = NaN ...

2 days ago | 0

| accepted

Answered
Having Trouble With Preallocating
m = zeros(1000000,2); Although a better idea would be to preallocate with the exact required size: L = numel(x); m...

2 days ago | 0

| accepted

Answered
How To Make Code Run Faster
1. The most important change you could make would be to preallocate the matrix |m|: <https://www.mathworks.com/help/matlab/ma...

2 days ago | 0

| accepted

Answered
How to convert datetime vector to military time
_"How can I change the format of the datetime array to military time so that the times may appear in chronological order?"_ Y...

2 days ago | 0

| accepted

Answered
How to replace nan with the mean of the four numbers surrounding it?
Download this FEX submission: <https://www.mathworks.com/matlabcentral/fileexchange/4551-inpaint-nans>

3 days ago | 0

Answered
Is it possible to automatically pass a predefined value to a variable assigned to questdlg, inputdlg, uigetdir (without the input window pop up)?
Ugh, this is an unfortunate situation to find oneself in... my commiserations. One possible solution is to shadow those function...

3 days ago | 1

Answered
How to publish MATLAB plots as graphs (including data points), and not just snapshots of the plot ?
Change the image format: <https://www.mathworks.com/help/matlab/matlab_prog/specifying-output-preferences-for-publishing.html...

3 days ago | 0

Answered
Is there a possibility to make a Start/Stop Pushbutton in guide?
_"Is there a possibility to just stop the measurement by using the same pushbutton and jump out of the function"_ Of course y...

3 days ago | 0

| accepted

Answered
How to replace half the number of specific element in an array?
To change random columns: >> A=[1 2 3 4 4 1 2 4 4 3 4 4 4 2 1 3 4 4 4 2 1 4 4] A = 1 2 3 4 4 1 2 4 ...

3 days ago | 1

| accepted

Answered
Extracting parts of a string
Importing the data as strings and then using regular expressions to parse them is inefficient, yet is not required because that ...

3 days ago | 0

Answered
How to add title and x/y-labels after generating multiple figures?
Your approach of obtaining and using explicit graphics handles is a good idea. However the axes title and axes labels are <https...

3 days ago | 0

Answered
I have old code wavread and want to replace with audioread
audioread('all_sentences_train_DR1_MKLS0_M.wav',[1,signal_size]);

4 days ago | 0

| accepted

Answered
how to find specific .mat file
<https://www.mathworks.com/help/matlab/ref/exist.html>

5 days ago | 0

| accepted

Answered
How to convert an array of decimal values to binary?
>> x = [0 0 0 2 0 3 0 1 0 0]; >> c = dec2bin(x(:),2); >> reshape(c.',1,[])-'0' ans = 0 0 0 0 ...

6 days ago | 1

| accepted

Answered
Count number of elements in a matrix
_"Count number of elements in a matrix"_ That is exactly what histograms are: >> A = [1 2 3 4 5 6 7 8 9 10]; >> B = [...

6 days ago | 0

| accepted

Answered
Matlab getting progressively slower in running simulation
Because this: _"The loop is used to concatenate values to a matrix using the cat function_" forces MATLAB to move the array in m...

6 days ago | 0

| accepted

Answered
Adding integer to specifc matrix columns using bsxfun
M(:,2:end) = M(:,2:end)+1 or V = ones(1,size(M,2)); V(1) = 0; M = bsxfun(@plus,M,V)

6 days ago | 0

| accepted

Answered
Assigning values for vector with number sequence
All you need is this: fun = @(n)r1*(n:-1:0)+r2*(0:n); p = cell2mat(arrayfun(fun,1:n,'uni',0)) And tested (here I wrot...

6 days ago | 1

Answered
How can I write an accent in a French sentence on a figure (title, xlable,ylabel)
Note that strings and char vectors are different things, and so the apostrophe needs to be defined differently: str = "d'it...

7 days ago | 1

| accepted

Answered
How to access n vector elements, then skip n elements, then access the following n elements and so on?
Assuming that the number of elements of your vector |A| is exactly divisible by 20: M = reshape(A,20,[]) V = M(1:10,:) ...

7 days ago | 1

| accepted

Answered
Linear interpolation of matrix
>> M1 = [1,1,1;2,2,2]; >> M2 = [3,4,5;6,7,8]; >> P1 = 0; >> P2 = 1; >> Pq = 0.5; % your random point >> V = [re...

7 days ago | 0

Answered
Sort a list of files using Remainder after division
Here is an outline of one way to do it (untested, but should get you started): D = 'original folder'; S = dir(fullfile(D...

7 days ago | 1

| accepted

Load more