A résolu


Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...

4 mois il y a

A résolu


MATLAB Basic: rounding IV
Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

4 mois il y a

A résolu


MATLAB Basic: rounding III
Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

4 mois il y a

A résolu


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

4 mois il y a

A résolu


MATLAB Basic: rounding II
Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

4 mois il y a

A résolu


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

4 mois il y a

A répondu
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...

7 mois il y a | 0

A répondu
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);

8 mois il y a | 0

A répondu
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...

8 mois il y a | 0

A répondu
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...

9 mois il y a | 1

| A accepté

A répondu
How to make a bus object?
Something like this should work. function create_Buses() % Bus object clear elems; elems(1) = Simulink.BusElement; ele...

9 mois il y a | 0

A répondu
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...

9 mois il y a | 0

| A accepté

A répondu
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...

9 mois il y a | 0

A répondu
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...

9 mois il y a | 0

A répondu
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 ...

9 mois il y a | 0

A répondu
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...

9 mois il y a | 1

A répondu
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...

9 mois il y a | 0

Question


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...

9 mois il y a | 1 réponse | 2

1

réponse

A résolu


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'...

9 mois il y a

A résolu


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...

9 mois il y a

A résolu


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-...

9 mois il y a

A résolu


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

plus d'un an il y a

A résolu


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 ...

plus d'un an il y a

A résolu


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...

plus d'un an il y a

A résolu


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 ...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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...

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


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.

presque 3 ans il y a

A résolu


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...

presque 3 ans il y a

Charger plus