Community Profile

photo

Stephen Cobeldick


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

Suspensa Vix Via Fit

Stephen Cobeldick's バッジ

  • 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

詳細を表示...

貢献した分野
表示方法

回答済み
how to extract and load images and data from multiple .mat files present in a folder
https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html D = 'path to the folder where the files ar...

1日 前 | 1

回答済み
creating matrix from a vector
>> v = [0,0,4,6] v = 0 0 4 6 >> n = ceil(v/2); >> w = 1:max(n); >> m = bsxfun(@times,v,bsxfun(@le,w(:),n)) m = ...

1日 前 | 1

| 採用済み

回答済み
How can I create an input row only excisting randomly only out of -1 and +1?
>> V = [-1,1]; >> X = randi(2,1,23); >> V(X) ans = -1 -1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 1 -1 1 1 ...

2日 前 | 0

回答済み
How to extract a value from mat file
S = load(...) S.Fs

2日 前 | 0

回答済み
Calling Matrix that is indexed, in a for loop
The easiest approach is to use a cell array: T{1} = [1,2]; T{2} = [2,3,4]; T{3} = [3,4,5]; T{4} = [3,4,5]; T{5} = [1,5]; f...

2日 前 | 0

回答済み
Question about import a .txt file into matlab
Your code has several issues, the most significant ones are: you incorrectly used the optional third input, apparently to try a...

3日 前 | 1

| 採用済み

回答済み
Index for subfolders without *.pdf files
Simpler and more robust: D = 'path to the main folder'; S = dir(fullfile(D,'*')); N = setdiff({S([S.isdir]).name},{'.','..'}...

3日 前 | 2

| 採用済み

回答済み
removing NaN values from mat file
load into an output variable (which is a scalar structure), then loop over the fields: https://www.mathworks.com/help/matlab/re...

3日 前 | 2

回答済み
fprintf matrix question. Need help.
No loop is required: >> x = 1:8; >> y = exp(x); >> fprintf('The force in link (%d)= %g N\n',[x;y]) The force in link (1)= 2....

3日 前 | 0

回答済み
Weird reading data: seed
The problem is data.seed. When you concatenate that numeric value onto character vectors MATLAB does not implcitly convert the ...

3日 前 | 0

回答済み
Changing the For LOOP conditions
If val has a value either 1 or 2: for k = 1:val:n If val is a boolean (i.e. 0 or 1) then simply do either of these: for k = 1...

4日 前 | 0

回答済み
What should I use instead of cd?
Your fullfile usage (which you commented out) does not make much sense, in particular: concatenating everything together before...

4日 前 | 0

回答済み
Extract files of specific extension from already searched folder
>> S = dir('*.*'); >> S.name ans = . ans = .. ans = archive ans = iregexp.m ans = iregexp.png ans = iregexp.zip ans = ir...

4日 前 | 1

| 採用済み

回答済み
Derivative of cell with matrices
fun = @(m)diff(m,1,2); out = cellfun(fun,X,'uni',0);

4日 前 | 0

| 採用済み

回答済み
Is there a way to select a good color scheme for easy figure viewing
Do NOT use jet ! Read these to know why: https://blogs.mathworks.com/steve/2014/10/20/a-new-colormap-for-matlab-part-2-troubles...

4日 前 | 1

| 採用済み

回答済み
Create a matrix from two matrices
>> GG = [S,[G(1,:);S(2,end)+cumsum(diff([0,G(2,:)]))]] GG = 1 2 1 2 1 3 4 1 2 2 3 4 5 ...

4日 前 | 0

| 採用済み

回答済み
Optimization with loops Error in optim.problemdef.OptimizationProblem/solve
I don't see a simple vectorized solution, but one for loop will be quite efficient: A = [1;3;5;7] B = [10;12;14;19] C = nan(s...

5日 前 | 1

回答済み
Need help fixing Vercat error
This line will cause an error: % ' '... If you want to continue to the next line then you need to use an...

5日 前 | 0

| 採用済み

回答済み
Problem using the matlab function randsample
MATLAB is trying to access the wrong randi function. This might occur if you created your own randi function, or a third-party ...

5日 前 | 0

| 採用済み

回答済み
variable format issue using copyfile
Your main bug is on this line: copyfile('finalImg1', 'destDir1'); Your code looks for files literally called 'finalImg1', whic...

5日 前 | 0

| 採用済み

回答済み
How to save every answers in matrix with 2 for loops.
You don't need loops, with the correct indices and one simple addition: >> [X,Y] = ndgrid(1:4); >> d1(X(:),:) + d2(Y(:),:) an...

5日 前 | 0

| 採用済み

回答済み
Error using interp1>reshapeAndSortXandV (line 424) X and V must be of the same length.
Assuming that meas.acc.data and meas.acc.time are vectors with the same number of elements, then diff on the data vector will re...

5日 前 | 1

回答済み
Combine strings and doubles and export to .txt
You can do this quite easily without any loops: C1 = {'Node coordinates and Elements','Coordinates'}; C2 = {'End Coordinates',...

6日 前 | 0

| 採用済み

回答済み
How to load in .m files in a sequence to Matlab?
"The problem is that I cannot load in all .m files at once..." Your question is confusing: .m files contain code (and in genera...

6日 前 | 1

| 採用済み

回答済み
Represent results in vector format.
>> A = 1:10 A = 1 2 3 4 5 6 7 8 9 10 >> B = [1,25,31,41,11,61,7,81,31,11;81,3,71,31,31,6,11,8,6...

6日 前 | 1

| 採用済み

回答済み
Is there a way to avoid repeating time-consuming calculations from odefun in the events function?
"Is there a way to do the time-consuming calculations only once at each time step?" Not really, because numeric ODE solvers do ...

7日 前 | 0

| 採用済み

回答済み
Numerical cell value changes to random symbols when using strcat - help needed
They are not random characters at all, they are in fact exactly the characters with exactly those character codes that you speci...

7日 前 | 0

| 採用済み

回答済み
Fibonacci sequence for loop
Your while loop does not exit when you probably think it should... Actually you will get the correct answer for m=3, 5, 8, 13, ...

7日 前 | 1

| 採用済み

回答済み
Dir on UNIX does not return .folder subfield
This has nothing to do with Unix vs. Windows OS. The feature of recursive folder searching and returning the folder was introduc...

8日 前 | 0

| 採用済み

回答済み
Reshape a 3D matrix
Rather than using meshgrid it would be simpler to use ndgrid: >> x = [1 2 3]; >> y = [4 5 6]; >> z = [7 8 9]; >> A = randi(9...

9日 前 | 0

Load more