# Stephen

Suspensa Vix Via Fit

**Statistics**

RANK**5**

of 244 281

REPUTATION**28 165**

CONTRIBUTIONS

**3** Questions

**7 470** Answers

ANSWER ACCEPTANCE **
100.0%
**

VOTES RECEIVED**4 594**

RANK**142** of 17 074

REPUTATION**7 982**

AVERAGE RATING**4.90**

CONTRIBUTIONS**22** Files

DOWNLOADS **814**

ALL TIME DOWNLOADS**63479**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Incorrect results from intersect when entering imaginary numbers

A = readmatrix('data1.txt') B = readmatrix('data2.txt') C = intersect(A,B,'rows')

en dag ago | 0

Trouble Reading Multiple .csv Files. "Intermediate dot '.' indexing produced a comma-separated list..." Error.

DataID(i).AxialStrain = DataID(i).RawData(1:ending,1); % ^^^ you need this index every time you ref...

en dag ago | 1

| accepted

loop on handles on GUI

fnm = sprintf('checkbox%d',i); handles.(fnm)

en dag ago | 1

| accepted

how to read files with different name using fid

fnm = sprintf('pfoil_1_var_1_%d.raw',i); fid = fopen(fnm,'r');

en dag ago | 1

Sorting Nested Structures based on Name

As far as I can tell, your actual goal is to sort the elements of all structures based on the content of their NAME field. Assu...

2 dagar ago | 0

| accepted

Find the index of an interval of values in cell array

index = cellfun(@(x) 500<x & x<956, SS, 'uniform', false);

3 dagar ago | 0

Replace comma with dot after fopen

fnm = 'trial_file.txt'; opt = detectImportOptions(fnm, 'VariableNamesLine',9, 'VariableUnitsLine',10, 'DecimalSeparator',',', '...

4 dagar ago | 1

How to split array into sub arrays?

"I have a feeling that creating individual variables is not most efficient method..." Creating lots of individual variables wou...

6 dagar ago | 0

| accepted

Writing pressed key to variable

I suspect that you are getting synchronous code (e.g. the evaluation of a script or function) mixed up with asynchronous code (e...

7 dagar ago | 0

Array don't store value?

Replace n = linspace(t01,t11,h); % Read its help to know why your useage is incorrect. with n = t01:h:t11;

7 dagar ago | 0

| accepted

How to create a vector inside a loop with data from a struct ?

T = {ECG.event.type}; % comma-separated list L = [ECG.event.latency]; % ditto xAB = strcmp(T(1:end-1),'A') & strcmp(T(2:end),'...

7 dagar ago | 0

| accepted

How to store data when a string condition of another column is met?

T = readtable('SED_FULL_NE.xlsx') [G,YEAR,STATE_ABBR] = findgroups(year(T.BEGIN_DATE),T.STATE_ABBR); COUNT = accumarray(G,ones...

9 dagar ago | 0

| accepted

find ( strcmp ( many_different_elements )

"But was wondering if there's a nicer way than to write 90 times in the find line" Of course: forget about repeated STRCMP call...

9 dagar ago | 0

Compare two Vectors and multiply equal entries

ID = 'ABCDEF'; val = 1:6; arr = 'AABBCDDDEFFE'; [X,Y] = ismember(arr,ID); out = val(Y(X))

11 dagar ago | 0

| accepted

Convert a cell array into arrays

Where C is your cell array: M = vertcat(C{:,4}) or M = cell2mat(C(:,4))

11 dagar ago | 1

| accepted

A function that counts the number of zeros in a vector

D = [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0]; nnz(D==0)

11 dagar ago | 1

Get the position of the next in row and next in column in a matrix

A reasonably simple, efficient, robust approach: A = [1,0,-2,0,0;2,8,0,1,0;0,0,3,0,-2;0,-3,2,0,0;1,2,0,0,-4] [C,R] = find(A.')...

11 dagar ago | 1

How can I use a floating point number with input command?

L = 10; S = sprintf('Enter the location of the force (0 - %0.2f meters): ',L); a = input(S);

12 dagar ago | 0

| accepted

Plotting ode 45 results

clear all % <- get rid of this. It seems that the main purpose of CLEAR ALL is to introduce bugs into beginners' code when they...

15 dagar ago | 0

Removing a character from a table (that's within a struct)

As far as I understand, you want to convert one column/variable of the table from cell array of character vectors to numeric. Th...

16 dagar ago | 1

| accepted

How to save images on a new folder created automaticaly and named after a video.

"For example : mkdir vid.Path vid.Name. This should create a new folder named after the video`s name right ? " No it won't, bec...

17 dagar ago | 2

| accepted

How to use a function with array output for each value in a different array?

"Ideally, I would want a matrix with each day's zenith angles on each row of the matrix." That is easy, just make sure that DEL...

18 dagar ago | 0

| accepted

Compare 2 strings without using ismember or strcmp

Presuming that your examples with invalid syntax are actually supposed to be string arrays: a = ["qwert34776";"dnfien/8863";"fe...

27 dagar ago | 0

| accepted

Reducing number of elements.

V = rand(100,1) Z = mean(reshape(V,10,10),1).'

27 dagar ago | 0

How can I add n columns to a matrix?

A simpler, more versatile, and much more efficient approach is to use ZEROS: R = size(X,1); C = number_of_new_columns; X = [...

27 dagar ago | 1

| accepted

I want to increase my cell's length by 8 times, by making each and every element copying by 8 times.

C = {'cat','dog'}; D = repelem(C,8)

27 dagar ago | 0

| accepted

How to use interp1 command?

Numbering your variables like that is a red-herring that makes this task more complex. MATLAB is designed to work efficiently w...

27 dagar ago | 0

| accepted

I am attempting to change the value 'K' to a value of 10 so I can add it to other numbers.

Putting meta-data (e.g. the suits, card types) into variable names makes this task much harder. Meta-data is data and should be...

27 dagar ago | 1

| accepted

Dimensions of arrays being concatenated are not consistent.

The problem is the line-break without any ellipses. But your code can be simplified anyway, removing that problem: x = [ConcVal...

27 dagar ago | 0

| accepted

How to subtract coloumn vectors of a cell array

inp = load('mycell.mat').mycell; % input data fun = @(m) 1+diff(m,1,2); % anonymous function out = cellfun(fun,inp, 'uni',0) %...

28 dagar ago | 0