Community Profile

photo

Turlough Hughes


Last seen: Today
113 total contributions since 2019

Turlough Hughes's Badges

  • First Review
  • 3 Month Streak
  • Thankful Level 1
  • Knowledgeable Level 3
  • Solver
  • First Answer

View details...

Contributions in
View by

Answered
incorrect input to ezplot function
ezplot requires a function handle as an input whereas you are inputting a vector. Seeing as you have the results as a vector I t...

3 jours ago | 1

Answered
How can I concatenate two vectors?
How can I 'join vector C and signal to get a matrix? Depends on whether signal is a column vector or row vector If it's a co...

3 jours ago | 0

Answered
How to do operations on nested cell array?
This should hopefully work but i ament able to test it myself right now as I'm away from my computer. The idea is to pass onecel...

7 jours ago | 0

Answered
How do i plot maximum values
You weren't actually calling the function. Secondly, the function had no input argument for threshold so I've included that. I a...

13 jours ago | 0

| accepted

Answered
how can i add column in matrix?
Depends what you want in that column but you could for example add a column of zeros as follows: A = [A zeros(size(A,1),1)]

environ un mois ago | 0

| accepted

Question


How to run checks on all rows of structure?
I want to check all the rows in the field of a structure and find out which rows are not empty. Can I get an index without using...

environ un mois ago | 1 answer | 0

1

answer

Answered
Create loop for multiple excel sheets/documents
One approach would be to use a nested structure with the first level down having a fieldname for each of the files, and then eac...

environ un mois ago | 0

| accepted

Answered
Import many excel files to Matlab- How to?
If all your data files are in that folder, and only your data files are in that folder and they are formatted the same, the foll...

environ un mois ago | 0

Answered
Counting black pixels in a binary image
Let's say you have a binary image B. You can get the number of black pixels by: numBlack=nnz(~B); and the number of white pixe...

environ un mois ago | 1

| accepted

Answered
Add a variable to table
Hey Sarah, Let's say you have two tables, as follows: T1=table((1:10).',(10:-1:1).'); T2=table((11:20).',(20:-1:11).',(1:10)....

environ un mois ago | 0

Answered
how to conver a string to a array or matrix
You can make a 3d matrix with the third dimensions being the same size as your range. You could then generate the results as fol...

environ un mois ago | 0

Answered
Is there a way to vectorize the definition of this matrix ?
Here's one way to do it in one line: z = y.*ones(n,m)==(1:n).'.*ones(n,m); I tested with the following inputs: y=1:10; n=5...

environ un mois ago | 0

| accepted

Answered
Intersection volume of two 3d alphashapes
Let's say you have two shapes that were developed as follows using column vectors as inputs: shp1=alphaShape(x1,y1,z1); shp2=a...

environ un mois ago | 0

| accepted

Answered
how to sort an array of elements corresponding to another array in increasing order ?
Have a look at the documentation for sort. You can do it as follows: [b,idx]=sort(b) a=a(idx)

environ un mois ago | 1

| accepted

Answered
Rename field arrays of a structure that hold identical name
I'm guessing your variable is called CCD_Dyad when you load a given .mat file, so given that you have 54 by 54 matrices I would ...

environ un mois ago | 0

| accepted

Answered
Check if input is a 4 element vector
if size(x,2)~=4 || ~isvector(x) || ~isnumeric(x) error('Input must be a row vector of length 4') end

environ un mois ago | 0

Answered
video processing for motion detection
So the method I suggested was to look at a single pixel, though you could also look at a few, or the entire image histogram, up ...

environ un mois ago | 0

| accepted

Answered
How to check if a table exists?
If you have a table assigned to the variable T, then I believe you just need to write: if ~exist('T')==1 to check that it does...

environ un mois ago | 0

| accepted

Answered
Intersecting Two Lines with Varying Angle
So I understand you just want to plot two lines where there is a specific angle between them. If we take one line as line y=0, y...

environ un mois ago | 0

| accepted

Answered
Filtering data from a table. How can I save values that are higher that 0.5?
You could get an index for each chunk of data as follows: idx=find(a(:,4)>0.5) idx2=find((idx(2:end)-idx(1:end-1))~=1); idx2=...

environ 2 mois ago | 0

Answered
Map a 2D matrix into 3D using loop for allotment along the 3rd dimension
The best way to deal with that is to use a cell array. I've also just renamed 'end' to 'idxend' and 'i' to 'c' as these are pred...

environ 2 mois ago | 0

| accepted

Answered
Finding the Sum of a Finite Series
Here I just use some examples for x,y and n, and also instead of 'i' I used 'c' as 'i' is designated for complex numbers. c=1; ...

environ 2 mois ago | 0

Answered
How to rotate surface code
Try the view function (documentation) view(0,0)

environ 2 mois ago | 1

| accepted

Answered
Segmenting a vector into multiple vectors based on the time stamps
Hey Masahiro, As I understand it, you have a column vector a_Y, and a second vector hit_idx which provides indices for each seg...

environ 2 mois ago | 0

| accepted

Solved


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

environ 2 mois ago

Answered
How to solve a plotting problem regarding straight lines
We don't really need all that code to answer the question. It would be much more preferable to just post some sample data. Anywa...

environ 2 mois ago | 0

| accepted

Answered
About simple recursion code
As I understand it you want to find the number of odd numbers from 1 to n. You shouldn't need to write a function for this, you ...

environ 2 mois ago | 1

| accepted

Answered
Sum N many of the same array, which are each offset by an integer M
The following should do the job: N = 3; M = 2; % Inputs A_t = [1:N N-1:-1:1]'; %single vector 1,2,3,...,N,...,3,2,1 A = zeros...

environ 2 mois ago | 0

Answered
Create multiple sub arrays in one line!
This is one way to go about it: a=strsplit(text(text~=' '),{'(',')'}) output=sprintf('%s',a{:})

environ 2 mois ago | 0

Answered
Loop Fuction to keep adding 1
You shouldn't need to write a function for this. I would just define your first x and y, and then n being the length: x1=1; y1=...

environ 2 mois ago | 0

| accepted

Load more