Community Profile

Daniel Bengtson

Last seen: 5일 전 2021년부터 활동

All

배지 보기

Content Feed

보기 기준

답변 있음
How to change just the marker edge thickness and not the entire line thickness in plots?
Plot the data without markers then add a scatterplot overlay of whatever marker size and width you want. x = rand(1,10); y = r...

24일 전 | 0

답변 있음
How to specify number of decimals in table2word or writematrix
You can use fprintf to do that. fprintf fid1 = fopen('filename.csv', 'w'); fprintf(fid1,'%.4f',0.999763425634234234);

대략 1개월 전 | 0

답변 있음
How does one use a string vector to select rows from a table. The vector length and the table height are unequal
T = %your table X = {"AGAP004746", "AGAP004753", "AGAP004756"}; T1 = T(cell2mat(cellfun(@(x) any(strcmp(x,X)),T{:,1},'Unifor...

대략 2개월 전 | 0

답변 있음
Mean of an oscillatory trajectory
p = polyfit(t,X,2); % fit a second order polynomial to the data newT = linspace(min(t),max(t)); % 100 evenly spaced steps ove...

대략 2개월 전 | 1

| 수락됨

답변 있음
How to make a bus object?
Something like this should work. function create_Buses() % Bus object clear elems; elems(1) = Simulink.BusElement; ele...

대략 2개월 전 | 0

답변 있음
Strategies to optimize nested for loops?
If you are going to be looping many times through a set of operations with a goal of execution time or efficiency, you should ma...

대략 2개월 전 | 0

| 수락됨

답변 있음
how to change the font size in a plot (only for the axes numbers) for double axis figure
Save the axes handle when you create the plot rather than using gca. [AX,h1,h2] = plotyy(1:10,rand(10,1),1:10,rand(10,1)); set...

대략 2개월 전 | 0

답변 있음
How can i plot a line from an already plotted line?
% for a given value of X that lands on the defined range of the black line, % define the corresponding Y value X = 5; b...

대략 2개월 전 | 0

답변 있음
How can I crop the image from an specific boundary?
The mask and blur causes a bit of artifacting in the text, and there is obviously a bit of color outside of the boundaries. I'm ...

2개월 전 | 0

답변 있음
How can I divide a whole circle into two sectors at an angle?
You could use the end points of the lines to generate a mask of that section of the image. Xpix = 480; Ypix = 480; figure; i...

2개월 전 | 1

답변 있음
Creating a map with Longitude, Latitude, Concentration (vector of values over time)
This is an admittedly hackish workaround that I used to navigate the same issue you are having. No promises that it will work fo...

2개월 전 | 0

질문

Why are pool workers going inactive while many iterations remain?
I have a task wrapped in a parfor loop where text data files are read then converted to numeric values and downsampled to common...

2개월 전 | 답변 수: 1 | 0

1

답변

문제를 풀었습니다

Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

3개월 전

문제를 풀었습니다

Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

3개월 전

문제를 풀었습니다

matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

3개월 전

문제를 풀었습니다

Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

10개월 전

문제를 풀었습니다

Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

10개월 전

문제를 풀었습니다

Are all the three given point in the same line?
In this problem the input is the coordinate of the three points in a XY plane? P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) how can...

10개월 전

문제를 풀었습니다

Remove All elements less than 5
Given an input vector x, remove all elements of x less than 5 . Example: Input x = [ 1 2 5 7 3 ] Output y is [ 5 7 ...

거의 2년 전

문제를 풀었습니다

Find the Best Hotels
Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

거의 2년 전

문제를 풀었습니다

Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

거의 2년 전

문제를 풀었습니다

Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

거의 2년 전

문제를 풀었습니다

Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

2년 초과 전

문제를 풀었습니다

Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

2년 초과 전

문제를 풀었습니다

Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

2년 초과 전

문제를 풀었습니다

Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

2년 초과 전

문제를 풀었습니다

De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

2년 초과 전

문제를 풀었습니다

Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

2년 초과 전

문제를 풀었습니다

Inner product of two vectors
Find the inner product of two vectors.

2년 초과 전

문제를 풀었습니다

Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

2년 초과 전