Community Profile

# Stephen Cobeldick

##### Last seen: Today
6,413 2014 이후 총 참여 횟수

Suspensa Vix Via Fit

#### Stephen Cobeldick's 배지

세부 정보 보기...

참여 게시물
보기 기준

답변 있음
How to raise a decimal numbers as power of A??
Either use a loop or cellfun: >> A = [1,5,3;4,5,9;7,8,9]; >> V = 0.1:0.11:10; >> C = arrayfun(@(n)A^n,V,'uni',0); And checki...

약 1시간 전 | 1

답변 있음
How to find and replace the content of an array
>> C = {'03/07/2019' '03/07/2019 00:30:00'}; >> X = cellfun('length',C)==10; >> C(X) = strcat(C(X),' 00:00:00') C = 03/07/2...

약 9시간 전 | 0

답변 있음
How to load files in order
Use either of the methods shown in the documentation: https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of...

약 9시간 전 | 0

| 수락됨

답변 있음
How to create an array with repeating values of a vector
m = repmat(v,20,1) or m = v(ones(1,20),:) or m = ones(20,1)*v or m = zeros(20,1)+v % requires >=R2016b or [~,X] = ndgrid...

약 20시간 전 | 0

| 수락됨

답변 있음
Function like "find" but for lines
>> B = find(A.').' B = 1 2 4 5 6 9 11 12

약 22시간 전 | 1

| 수락됨

답변 있음
How can I remove identical cell entries containing small arrays
Two efficient loops, no third-party functions: S = load('example.mat'); C = S.connect_group; N = numel(C); X = true(1,N); f...

1일 전 | 0

답변 있음
Matrix split in vector
>> B = nonzeros(A.') B = 1 2 3 4 5 6 7 8

1일 전 | 0

| 수락됨

답변 있음
Import data as a structure array from a text file with different titles in the middle.
opt = {'MultipleDelimsAsOne',true}; out = {}; [fid,msg] = fopen('datafile.txt','rt'); assert(fid>=3,msg) while ~feof(fid) ...

2일 전 | 0

| 수락됨

답변 있음
Generate multiple matrices based on multiple inputs
P = 'Select which type(s) you would like: 1, 2 or 3. For multiple, seperate numbers with a space.'; C = inputdlg(P); V = sscan...

2일 전 | 1

| 수락됨

답변 있음
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...

4일 전 | 2

답변 있음
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://...

5일 전 | 1

| 수락됨

답변 있음
Simple Matrix Reduction Question. Ones and Zeros.
Simpler: >> [B,~] = find(A.') B = 4 1 2 3

7일 전 | 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...

7일 전 | 2

| 수락됨

답변 있음
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...

8일 전 | 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...

8일 전 | 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...

9일 전 | 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),'')

11일 전 | 0

답변 있음
"My question is why the term 1.0e-05 * appearing?" Because you are displaying the values in the command window using long forma...

13일 전 | 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); % ^ ...

13일 전 | 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...

13일 전 | 1

| 수락됨

답변 있음
Adding numbers in array in a specific order
>> [~,~,X] = unique(a); >> d = accumarray(X(:),b(:)) d = 81 122 245 985 2663

14일 전 | 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

14일 전 | 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...

14일 전 | 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...

14일 전 | 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...

15일 전 | 0

답변 있음
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...

16일 전 | 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 ...

16일 전 | 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...

16일 전 | 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...

18일 전 | 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:...

18일 전 | 0

| 수락됨