# David Fletcher

### De Montfort University

Last seen: presque 3 ans il y a Actif depuis 2018

Followers: 0   Following: 0

Prior roles - technician (pharmaceutical chemistry, pharmacognosy and electron microscopy). Currently working as a senior technician in pharmaceutical technology.

All

#### Feeds

Afficher par

Réponse apportée
Create a loop for this matrix
Just writing something with a loop on the fly (and I stress this is neither robust, nor particularly efficient), but it may be s...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Build an array of square and square root of user input
The code you have written largely does what is asked, the only thing that is missing is that you are throwing the calculated sqr...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
plotting multiple line graphs in one plot
Might need some more tinkering - this is limited to 7 lines rather than the 20 you have in your code tc(1:20)=298; th=300:50:1...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
I need help with the error called 'Error using vertcat Dimensions of arrays being concatenated are not consistent.'
The statement tries to stack a 2x2 on top of a (2x4) x 2 M = [diag(checkpoint)-diag(checkpoint); -eye(2) zeros(2); zeros(2) eye...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Removing row of a nx3 matrix if at any row the 3rd column is 0
b = [1 2 0;3 4 5;3 2 -1;5 6 0;1 3 6] idx=b(:,3)<=0 b(idx,:)=[]

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to multiply 8*8 data sets elementwise?
If you're just multiplying by the scaler of 1.02 then Qxxepoch1{:,:}*1.02 will do what you want without a loop

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to process multiple dot mat file using for loop
Wouldn't it be better to extract what you want into a single matrix and then just save the one matrix with all the data rather t...

environ 3 ans il y a | 1

Réponse apportée
Write a function wich oly needs a file input as argument
It's a warning that you have declared variables (decYear, intYear, dayNum etc.) and not used them anywhere in the code. The code...

environ 3 ans il y a | 0

Réponse apportée
How do i scan pixel from an rgb image and then if red value is higher than 200 show red only and if its lower = all 3 colors = 0
May not be the best answer - I don't do much image manipulation work %load and display image imageData=imread('test.jpeg'); s...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Extract multiple matrices from an array by excluding specified numbers.
Will do the job in this case, but is not massively robust. Would need additional code to enforce the number of elements in the v...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
how can i edit the input prompt while using inside a loop
n = 5; i=1; while(i<=n) prompt=sprintf('Enter the value of Lower Bound %d \n a =',i); a = input(prompt) ...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
Combine logical cell array based on 'or' condition
C{1,1}|C{1,2}|C{1,3}

environ 3 ans il y a | 0

Réponse apportée
if variable i = zero then change row j of the same row to 0 - table
col16zero=(pvdaqdata10{:,16}==0) pvdaqdata10{col16zero,3}=0

environ 3 ans il y a | 1

| A accepté

Réponse apportée
How can I separate the data into two groups.?
%Get index of max values in each column [val idx]=max(data) %Create logical vector of max values where the max value is the fi...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
How to write (partial)file names into a table?
Try this - (I'm assuming you want to store the extracted chars as an actual number) integ(m,4)=str2double(extractBetween(fileNa...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
A task that requires multiple outputs in a specific order.
function [a, b, c, d] = corners(matrix) a=matrix(1,1); b=matrix(1,end); c=matrix(end,1); d=matrix(end,end); ...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
For loop to extract string with if function
Nothing seems to be particularly wrong in the code - the only thing that stands out is that the str variable will be overwritten...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
Doubt involving a for loop within another
Try changing the line to: jvals(i,:)=linspace(0,0.03,n) You may also need to change the line to curvatura=jvals(i,j) if curv...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Obtain and plot values of a "for" loop
you need to retain the values of y as you go through each iteration of the loop. There are a few ways of doing it, but perhaps t...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
help me , Treasure hunt game code
Try this: f = floor(rand()*100) + 1; n = 0; while 1 t = input('t') if t<f disp('up') elseif t>f ...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
I want to do the calculations in the for loop for each diameter, D value, and then draw the graph for each result, but with this code, I calculate one value and only one value appears in the graph. Where am I doing wrong? Sorry I'm beginner in mtlab
As a general guide have a look at: L=(2000+(5*50)); T=5+5*0.25; It=0.0075*L; ht=0.15*T; bt=0.50*It; e=0.0003*(5+50); t=15...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to execute the same operation on various .csv files?
You would need to incorporate your code into one of the examples, also you would need to store the intended output as the loop p...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Problem with if statement
There are numerous errors in the code, the condition on the if statement makes no sense I assume you mean: if r(i)>=minval & ma...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to get the x axis and y axis to start at 0 when adding regression line in Figure window
Does the axis command do anything: axis([0 70 0 70])

environ 3 ans il y a | 0

Réponse apportée
I'm getting an error and don't know how to fix it.
The filename is the name held in the variable, the file isn't called 'filename' fid=fopen(filename,'r')

environ 3 ans il y a | 1

| A accepté

Réponse apportée
I want to draw graph. use 'for/while-end loop' and use 'plot' just one time
Something like: %06_Diffusion clear C0 = 0.2; % wt% Cs = 1.0; D = 2.6e-11; x = 0:0.1:10; % mm x = x./1000; % meter index...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Concatenating variables within a table
Not sure if this is what you want, but stack will pack the table packedTable=stack(T1,1:114) You'll end up with two columns: ...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
Show rows of a column of a table that meet a certain condition in another column
table.x(table.y==0)

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to get the last two digits of a number?
x=4974 y=floor((x/100-floor(x/100))*100)

environ 3 ans il y a | 2

| A accepté

Réponse apportée
Array indices must be positive integers or logical values
Error is caused by element 1481 of IntOutAdr which is 0 - this will cause an indexing error

environ 3 ans il y a | 1