Community Profile

photo

Turlough Hughes


73 total contributions since 2019

Turlough Hughes's Badges

  • Knowledgeable Level 3
  • Solver
  • First Answer

View details...

Contributions in
View by

Answered
Import data from multiple .dat files, remove headerlines, and read columns into array - but the number of headerlines differs across each .dat file
If 'Dose' appears as the first four elements of this line only, and similarly 'alpha' as the first five of the other line, you c...

2 días ago | 0

| accepted

Answered
Reorganize a table of points based on their coodinates
I put down an index here for sorting the points as you requested. It should do the job. ptstemp=input_points [~,idx(1)]=min(su...

2 días ago | 1

| accepted

Answered
How to I locate intervals of time series data, with intervals of data having specific length and similar mean?
If you have a timeseries ts you could do the following (assuming your timeseries is in seconds) idx=ismember(ts.Time,[600:600:l...

3 días ago | 0

Answered
Getting rid of data that does not meet conditions: Poincare section
You can get your data where x>0 as follows: ND=Data(:,find(Data(1,:) > 0)) % x > 0, for brevity I just call this ND. you can t...

4 días ago | 1

| accepted

Answered
How to read this file in MATLAB?
You can use the following to read your into a variable D. fid=fopen('silicon_simr1.txt'); fgetl(fid) VarNames=fgetl(fid); st...

4 días ago | 1

Answered
Combination of textarrow and textbox
You could do the following: xtip=0.5; ytip=0.5; % arrow tip coordinates (normalized units) w=0.15; %box width h=0.1; ...

4 días ago | 0

| accepted

Answered
Improving the compactness of code
You could put them in a structure as follows: s.pop=pop; s.gdp=gdp; s.fp=fp; s.lr=lr; and then to run the loop you just itera...

8 días ago | 1

Answered
Finding all numbers which is divisible by 5
This is your answer assuming the while loop is a must: a=input('Enter the threshold: '); disp("Following number is devided by...

9 días ago | 0

Answered
How to concatenate these subplots on one image in matlab?
Hi Gehan, Are the images all the same size and class? If so you can just write concat_img=[V1img;H1img;D1img;A1img]; imshow(c...

12 días ago | 0

| accepted

Answered
Zero padding a 3d structure according to maximum length
Hi Uerm, Lets call your data mycellarray. You can padd the second dimension of all tensors to have the same length as the one w...

12 días ago | 0

| accepted

Answered
How can I compare two cells which consist of the same values, and write the row number of the first to the other file
You actually don't need to run the comparisons. The unique function provides for this directly. So just modify the second line o...

12 días ago | 0

| accepted

Answered
How to find intersection of 2 matrices
There is a handy function for exactly this: [xi,yi]=polyxpoly(x_1,y_1,x_2,y_2); It requires the mapping toolbox which doesnt t...

13 días ago | 0

Answered
Extract Structure element dynamically
I would just convert it to a cell array which is easier to index through as you require c=table2cell(timetable2table(joinedtime...

14 días ago | 0

| accepted

Answered
mmread getting frames of video
To get your 10 frames each second from 0 to N seconds you can do the following (Note though that if you are converting from a st...

15 días ago | 0

Answered
How do I retrieve a specific range of values from a cell?
Let's say your cell is called data and this is a 1 by 4 cell array with each cell containing column vectors of size 685 x 1. You...

15 días ago | 0

| accepted

Answered
How to combine multiple .txt and calculate Mean, Std, Min, Max
Put all your txt files in a folder and you can then use the following myfolder='name of the folder' fils=dir([myfolder '\*.txt...

16 días ago | 1

| accepted

Answered
Index exceeds - for loop
The problem is you are specifying indices that dont exist in val. val is a column vector of 10201x1 values, i.e. 10201 rows and ...

16 días ago | 0

| accepted

Answered
Function returning multiple plots
Just use the hold on statement as follows: myfunction(input1); hold on; myfunction(input2); myfunction(input3); myfunction(i...

18 días ago | 0

Answered
Feature extraction surf, storing points
One way is to store as a struct, for example s(ii).features=features; %where ii would be incrementing as you iterate through ea...

26 días ago | 1

Answered
iterate through text files and read them as a matrix
You have to make sure your filename and path are correct. Try modifying your input to readmatrix as follows: A=readmatrix([myf...

27 días ago | 0

| accepted

Answered
Getting rid of a for loop
The following should do the job. ind=input(1:end-2)>input(2:end-1) & input(2:end-1)<input(3:end); ind=[false; ind; false]; % ...

27 días ago | 1

Answered
How to match two date columns
To find the rows in your table, called dsColShort, wherein run_date and trade_date are equal you can use the following code idx...

29 días ago | 0

| accepted

Answered
seperating vertical and horizontal images from an image seperately
I'm not sure what you mean by vertical / horizontal image but from your equation it looks like you want to find the absolute d...

alrededor de 1 mes ago | 0

Answered
For loops and If statements not working correctly
First of all, when you use element-wise operators (.* .^ ./) like you have been trying you don't necessarily need to run the for...

alrededor de 1 mes ago | 1

| accepted

Answered
Help with Loops and Switch cases and Mean
Hi Deriniece, You could modify your code as follows: Q=''; ii=1; while ~strcmpi(Q,'No') Q=input('Would you like to ente...

alrededor de 1 mes ago | 1

Answered
New to matlab. Trying to code with excel.
[data,varnames]=xlsread('myfilename.xlsx') sumdata=sum(data); % sumation of columns T=array...

alrededor de 1 mes ago | 0

Answered
Read & Plot to compare Data in Multiple SpreadSheets
Hi Raghnu, I reckon you should store your data in a structure and use dynamic fieldnames to have a fieldname corresponding to e...

alrededor de 1 mes ago | 0

| accepted

Answered
How to add values from if statements to a column
You just have to make an index for every time your if statement is satisfied. See the modified code. function [x,y]=valuesof(da...

alrededor de 1 mes ago | 1

| accepted

Answered
Collect double values of a matrix
Ok Following your comment I've edited my answer: I would first find rows which have equal X and Z values. c=1; for ii=1:size(...

alrededor de 1 mes ago | 0

Answered
Select a point on the graph
You can do the following: [~,ind]=min(sqrt(member_value(:,1).^2+member_value(:,2).^2)); %find index for point closest to origin...

alrededor de 1 mes ago | 0

Load more