Community Profile

photo

Stephen Cobeldick


Last seen: Today
6,669 2014 年以降の合計貢献数

Suspensa Vix Via Fit

Stephen Cobeldick's バッジ

  • Personal Best Downloads Level 4
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • GitHub Submissions Level 3
  • First Submission
  • Master
  • 36 Month Streak
  • Thankful Level 4
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer

詳細を表示...

貢献した分野
表示方法

回答済み
Open multiple .csv files, process and save them in a structure
You need to fix this line otherwise your loop will only iterate once: for i = 1:length(filename) % ^ this must be a col...

約16時間 前 | 0

| 採用済み

回答済み
Shuffling numbers while keeping identical numbers next to each other
>> A = [1,1,2,3,3,4,6,6,6,6]; >> X = diff(find([1,diff(A),1])); >> C = mat2cell(A,1,X); >> Y = randperm(numel(C)); >> V = [C...

約17時間 前 | 1

| 採用済み

回答済み
Dynamic call to structure elements
You can trivially access the fields of a structure using this syntax, where F is the fieldname: S.(F) See: https://www.mathwor...

約21時間 前 | 0

回答済み
MATLAB example not working.
Typical reasons why that function might not work: scatteringchanmtx was introduced in R2017b. It will not work with earlier MAT...

1日 前 | 0

| 採用済み

回答済み
How to use varargin and varargout?
As their documentation explains, both varargin and varargout are cell arrays. So if required (e.g. to perform numeric operations...

2日 前 | 0

回答済み
Data types of arrays in a function
B = int8(A); if any(B(:)~=A(:)) B = A; end Note that this is a more versatile approach because it does not use hard-code...

2日 前 | 0

回答済み
Merge specific text files
You will need two loops, the outer loop for M1, M2, etc, and the inner loop for the files R1,R2,R3,...R100, e.g.: D = 'path to...

3日 前 | 0

| 採用済み

回答済み
Who could get all the data in the attached file by the matlab?
>> rgx = '([-+]?\d+\.?\d*([eE][-+]?\d+)?)'; >> str = fileread('tem-001.txt'); >> tkn = regexp(str,[rgx,'\s+',rgx],'tokens'); ...

3日 前 | 0

| 採用済み

回答済み
Trying to create a set of matrixes using a for loop. I have an error on line 23: Array indices must be positive integers or logical values. Basically making matrixes labeled ke1, ke2, ke3...
There are multiple issues with your loop: you are attempting to use invalid indices (e.g. 0, pi/2, etc.). you are providing fo...

5日 前 | 1

| 採用済み

回答済み
i have a variable in my workspace and i dont know its name directly
Do not load directly into the workspace, always load into an output variable (which is a scalar structure): S = load(...); The...

6日 前 | 0

回答済み
Extract number and infromation from multiple image files ?
One simple regular expression does this quite efficiently: D = 'Defolder'; S = dir(fullfile(D,'*.jpg')); N = {S.name}; T = r...

8日 前 | 1

回答済み
Add lines (data) to a fopen file without overwriting the previous data
Try the append option: https://www.mathworks.com/help/matlab/ref/fopen.html#btrnibn-1-permission NS = fopen(... ,'a+'); % ...

10日 前 | 0

| 採用済み

回答済み
How to find minimum value from loop using if function iteration?
>> a = 135500; >> dx = 1000; >> b = floor(a/dx) b = 135

10日 前 | 0

| 採用済み

回答済み
How to sort folders in imageDatastore?
https://www.mathworks.com/matlabcentral/answers/416241-how-to-sort-the-files-obtained-by-imagedatastore

11日 前 | 0

送信済み


Number to Scientific Prefix
Convert a numeric value to an metric prefixed string (SI/engineering). Bonus: binary prefixes!

13日 前 | ダウンロード 9 件 |

Thumbnail

送信済み


Scientific Prefix to Number
Convert a metric prefixed string into numeric value (SI/engineering). Bonus: binary prefixes!

13日 前 | ダウンロード 5 件 |

Thumbnail

回答済み
Why I the data processed by the matlab is wrong, it reports three wrong results,what is the reason?All the data and .m files are included ,who can help me?
opt = {'CollectOutput',true }; [fid,msg] = fopen('tem-009.out','rt'); assert(fid>=3,msg) str = ''; while ~strncmp(str,'-',1)...

13日 前 | 0

回答済み
For loop in function handle
You can simply store function handles in a cell array of any size and use cellfun. No loop required. >> C = {@sin,@sqrt,@pow2};...

15日 前 | 1

回答済み
Changing elements of vector with matrix
No loop required: >> v = 1:numel(a); >> x = any(v>=b(:,1) & v<=b(:,2), 1); % requires MATLAB >=R2016b >> a(x) = 1 a = 1 ...

15日 前 | 1

| 採用済み

回答済み
Merge files with the same prefix.
This should get you started (untested, but gives an outline of how you could do this): D = 'path to the folder where the files ...

15日 前 | 0

| 採用済み

回答済み
How to sort one array based on another of a different size
As Rik wrote, the MATLAB solution is to use ismember, e.g.: >> A = {'a','a','b','c','c','d','d','d','d','e','e'}; >> B = {'d',...

15日 前 | 1

| 採用済み

回答済み
Select first n nonzero elements in each row of matrix
Linear indexing does this simply and efficiently. The trick is to work down the columns, which requires transposing: >> A = [1,...

15日 前 | 0

| 採用済み

回答済み
What does the varargin function do and what does varargin{:} mean?
"What does the varargin function do..." varargin is not a function, it is a cell array which contains any number of optional i...

15日 前 | 0

| 採用済み

回答済み
Break command doesn't stop the For loop
"Can anybody please explain me why the 'break' command doesn't work in the following code?" Explanation: The reason is because ...

15日 前 | 1

| 採用済み

回答済み
Reading multiple values from an n*1 cell array.
The most efficient way: >> C = {'3.7482.85813621.44775413.853117-9.113155'; '3.7492.86975821.44393913.816126-9.117885'}; >> M ...

15日 前 | 1

| 採用済み

回答済み
Formatting the JET colormap
The colormapeditor changes the colormap of the current figure. It does not save or store the colormap in any way. You will most...

16日 前 | 1

| 採用済み

回答済み
Get textscan to sort the rows as matrices and columns as cells
opt = {'Delimiter',',', 'CommentStyle','@', 'CollectOutput',true}; [fid,msg] = fopen('assignment1.txt','rt'); assert(fid>=3, m...

16日 前 | 0

| 採用済み

回答済み
How to use multiple variables in a name structure
The most efficient approach is to use sprintf (and is what experienced MATLAB users would do): for k = ... fig_name = spri...

16日 前 | 0

回答済み
Datetime conversion input format
According to the datetime documentation, the correct format characters for times are: hours: 'HH' or 'hh' (for 24/12 hour clock...

16日 前 | 0

| 採用済み

回答済み
Extract rows in a Matrix based on column values of another Matrix.
The standard MATLAB approach to this common task is to use the second output of ismember, e.g.: >> [X,Y] = ismember(p,q(:,1)); ...

20日 前 | 0

| 採用済み

Load more