Community Profile

photo

Stephen Cobeldick


Last seen: Today
6,404 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

詳細を表示...

貢献した分野
表示方法

回答済み
How to convert string "26/7" into a double variable?
>> str = '26/7'; >> vec = sscanf(str,'%f/%f'); >> vec(1)./vec(2) ans = 3.7143 One line (but I would not recommend using thi...

約3時間 前 | 1

回答済み
How to save cell array of workspace vars into mat?
save('test.mat', vars{:}) How it works: https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://...

1日 前 | 1

| 採用済み

回答済み
Simple Matrix Reduction Question. Ones and Zeros.
Simpler: >> [B,~] = find(A.') B = 4 1 2 3

3日 前 | 1

回答済み
How do I match nested parenthesis (brackets, or braces) with dynamic regular expressions?
This matches the outer-most matched pair of parentheses: >> str = 'asdf (( dwer e: ( asdedsdskek))::)asd fg ( qwe 4 dfy5 57) q3...

3日 前 | 1

| 採用済み

回答済み
Converting txt file string to matrix.
>> str = '{co-ordinates 1.5 2.5 4.8 weighting 11.7}{co-ordinates 2.5 2.8 1.7 weighting 21.4}{co-ordinates 1.5 2.5 4.8 weig...

4日 前 | 0

| 採用済み

回答済み
I am trying to run this script, but it only returns the last part of the switch- the otherwise part, please help...
Your switch condition will not work as you expect. If you want to use logical comparisons for the case values, then you will nee...

4日 前 | 0

回答済み
Calling a nested function from a dynamic regular expression throws an error
The best and most general workaround I have found so far is to call regexp from a local function, with function handles to the n...

5日 前 | 0

回答済み
how to center a string
str = '23'; num = 9; tmp = (num-numel(str))/2; out = sprintf('%*s%*s',fix(tmp)+numel(str),str,ceil(tmp),'')

7日 前 | 0

回答済み
Asking about an output
"My question is why the term 1.0e-05 * appearing?" Because you are displaying the values in the command window using long forma...

9日 前 | 0

| 採用済み

回答済み
How to filter a structure array based on a numeric value from a field?
You will need to concatenate the comma-separated list into one numeric array, e.g.: trips([trips.dir_id] == 1); % ^ ...

9日 前 | 0

| 採用済み

回答済み
how would I add several matrices into one? (assembling global stiffness matrix for FEA)
This is easy when you store all of the matrices in one cell array, then you just need a simple for loop: >> C = {[1,1;1,1],[1,1...

9日 前 | 1

| 採用済み

回答済み
Adding numbers in array in a specific order
>> [~,~,X] = unique(a); >> d = accumarray(X(:),b(:)) d = 81 122 245 985 2663

10日 前 | 0

| 採用済み

回答済み
How can I sample n elements from each column of a matrix?
>> X = sub2ind([4,5],randi(4,2,5),[1:5;1:5]); >> B = A(X) B = 3 8 9 13 20 3 7 10 15 20

10日 前 | 0

回答済み
How to call a function
Make these changes: clear,clc,close all % <-------- DELETE THIS AWFUL ANTIPATTERN LINE OF EVIL function [C1, C2, C3, C4, C5, s...

10日 前 | 0

| 採用済み

回答済み
Passing extra output arguments from ode
"In summary my question is, how do I obtain f for the same time instants at which x is obtained." Using a persistent variable o...

10日 前 | 0

| 採用済み

回答済み
why matlab always show my equation as matrix dimension
Most likely you need to follow the advice given in the error message and use array operations, e.g.: y = (668.061./x).*(-39-exp...

11日 前 | 0

回答済み
readcell command doesn't work anymore!
This only reads one cell: "Range",'B3:B3' There is nothing in your code that reads "all non empty cells in col B starting from...

12日 前 | 0

| 採用済み

回答済み
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
function Weight= SGD_method(...) alpha=0.9; N=4; end % <--------- DELETE THIS LINE! for k=1:N ...

12日 前 | 0

回答済み
Dynamic regular expression replacement: token number
It can be done with one dynamic replacement expression: >> str = '(1st MT)_fjezhfjksdhf_(2nd MT)'; >> rgx = 'MT'; >> out = re...

12日 前 | 0

回答済み
how to do the matrix computation
>> M = c(1,2:end).' + c(2:end,1).' - c(2:end,2:end); % requires MATLAB >= R2016b >> M = triu(M,1) + triu(M,1).' M = 0 1...

14日 前 | 1

| 採用済み

回答済み
Define a series of matrices
Using numbered variables is not going to be neat or efficient. The MATLAB approach would be to use one array, e.g.: sigma = -5:...

14日 前 | 0

| 採用済み

回答済み
How to interpolate column and row?
Use interp2, e.g.: >> Y = [1.0101,1.25,2,5,10,25,50,100]; >> G = [3,2.8,2.6,2.4,2.2,2,1.8,1.6,1.4,1.2,1,0.8,0.6,0.4,0.2,0,-0.2...

15日 前 | 1

| 採用済み

回答済み
'run' command with input argument - MATLAB 2018a
run does not work with functions, it only works with scripts: https://www.mathworks.com/help/matlab/matlab_prog/scripts-and-fun...

15日 前 | 0

| 採用済み

回答済み
I have 16 GB of RAM, why can't I load a 3.5 GB file?
This line has very inefficient use of memory, and is likely the cause of the error: video=uint16(zeros(zeilen,spalten,frames));...

16日 前 | 2

| 採用済み

回答済み
Moving large matrix from function workspace to base workspace?
The correct function to use is assignin, not evalin: assignin('base','data',data) Probably even better would be to just use th...

18日 前 | 3

| 採用済み

回答済み
Constructing a circular type of matrix
For MATLAB versions >=R2016b: >> M = max((1:4).',1:5) M = 1 2 3 4 5 2 2 3 4 5 3 3 3 4 5 ...

18日 前 | 0

| 採用済み

回答済み
find missing element between two matrix
>> A = [1,2;3,6;3,5;1,4;4,6;2,7;1,6;6,5;2,3;6,7;3,4]; >> B = [1,2;1,6;2,3;3,4;4,6]; >> R = setdiff(A,B,'rows') R = 1 4 ...

18日 前 | 0

| 採用済み

回答済み
New line after fprintf
Add a newline at the end of the fprintf format string: fprintf('....\n',D) % ^^ newline!

18日 前 | 1

| 採用済み

回答済み
fprintf cell array of two classes
No need for complex strings, ugly loops, or slow arrayfun, you just need one simple fprintf call:: >> A = ['USA' ; 'CAN' ; 'FRA...

18日 前 | 2

回答済み
store workspace file in variables using a for loop
Your approach is entirely the wrong way around. Putting meta-data (e.g. pseudo-indices, subject IDs, parameter values, etc.) int...

18日 前 | 0

| 採用済み

Load more