Answered
using a while loop to add one to a vector
function vec = addOne(vec) i=1; while i<=length(vec) vec(i) = vec(i)+1; i=i+1; end end

3 years ago | 0

| accepted

Answered
.txt files?
theFiles = dir('*.txt'); for k = 1 : length(theFiles) baseFileName = theFiles(k).name; A(:,k)=readmatrix(baseFileName...

3 years ago | 0

| accepted

Answered
Fill outliers without a loop for each rows
Try this: matrix= filloutliers(matrix,'nearest','median',2);

3 years ago | 0

| accepted

Answered
graph mesh code help
a=@(x)1-exp(-x/sqrt(2))./(2+exp(-x/sqrt(2))); b=@(x)exp(-x/sqrt(2))./((2+exp(-x/sqrt(2))).^2); c=@(x)((exp(-x/sqrt(2)).*(exp(-...

3 years ago | 2

| accepted

Solved


drowsy?
This dog() may be drowsy or function immediately when you call, return 1 or 0 accordingly within 2/10 second.

3 years ago

Solved


convert?
* Given a string containing a number followed by pounds or kgs, for example: * 'Billy lost 22 pounds in four weeks.' * 'Maria ...

3 years ago

Solved


polar inertia
given locations of a set of unit masses on complex plane, find polar moment of inerta about the origin. for example output 4 if ...

3 years ago

Answered
reading all documents with a for loop
Assumig all the pictures are the same size. for k=1:750 A(:,:,:,k)=imread(sprintf('PetsD2TeC1_00%03d.jpg',k));%store all p...

3 years ago | 1

| accepted

Solved


Easy Sequences 77: Powers of Fibonacci Numbers
Given integers and , we are asked to evaluate the following function: . That is, equals raised to the power of the -th Fibona...

3 years ago

Solved


Measure the hydraulic conductivity with a constant-head permeameter
A constant-head permeameter is a device for measuring the hydraulic conductivity of a soil sample. In this problem the sample i...

3 years ago

Answered
How would I loop this code to read each variable in my excel file so it can assign a grade for each number?
x=[69 97.1400 87.7400 93.6600 59 100 85.3600 62.8100 89.9300 100 91.3500 96.6700 76.7300 97.8600 66.4700 85.6000 ...

3 years ago | 0

| accepted

Answered
Can we convert a jpg or png image into a fig file via Matlab?
a=imread('yourImage.jpg'); b=figure; imshow(a); saveas(b,'b.fig');

3 years ago | 0

Solved


3D Plots and Colorbars
Use the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and ...

3 years ago

Answered
how to select values in one set of data based on value range in another data set
speed=[5,12,11,1,9,7,6,3,4,7,8,1,3,6,4,6,7]; time=1:length(speed); speed(time>=4&time<=9)

3 years ago | 1

Answered
fprintf two 3x1 matrix's w/ text
bearing=[30 50 60];range=[600 1237 579]; for k=1:3 fprintf('The potential PIW bears %g from the CG Asset at a range of %g ...

3 years ago | 0

Answered
how to make a matrix A give me 0 in column 1 up to the last row
Hard to understand what you are asking. A=[1 2 3;1 2 3;1 2 3]; Anew=[zeros(3,1),A]

3 years ago | 0

| accepted

Answered
How do I make a matrix with a repeating pattern but with different values
x=randi(100,5,1) y=randi(100,5,1) z=zeros(size(x)); M=[x';z';y';y';z';x'] M=reshape(M(:),3,[])'

3 years ago | 0

Answered
can i do inverse for array in matlab using for ? how ?
If det(x) ~=0, then matrix is invertable.Your matrix above is not. x=[1 2 3; 4 5 6; 7 8 -1]; det(x) r=rref([x,eye(size(x))])...

3 years ago | 0

Solved


Calculate Wind Chill Factor
The NWS Wind Chill Temperature (WCT) index formula for calculating the dangers from winter winds and freezing temperatures: Cal...

3 years ago

Solved


Calculate Angle From Axis
Given coordinates x and y, an axis ("X" or "Y"), and a direction ("cw" or "ccw", meaning clockwise and counterclockwise, respect...

3 years ago

Solved


A Binary Search
One way to locate a target value in a sorted array, is to use a binary search algorithm. Here, you test if the midpoint in the a...

3 years ago

Solved


Interpolated Value Between Two Points
Given two points, and , a new location x, and a method "linear" or "cubic", return the value of a linear or cubic interpolant t...

3 years ago

Answered
Extract numbers from char type
a='4.65 km'; r=regexp(a,'\d*[.]*\d*','match'); str2num(r{1})

3 years ago | 0

Answered
please guide me how to make plot from –pi to pi.
k = 12; size = 39; X =@(t) size * cos (k*t) .* cos(t); Y =@(t) size * cos (k*t) .* sin(t); t=-pi:.01:pi; ...

3 years ago | 1

Solved


Create spiral matrices
Create a matrix of a given size with sequential elements spiraling inward. For matrix height m and width n, the output should ...

3 years ago

Solved


Generate Pascal's Triangle Matrix
Pascal's triangle is an arrangement of numbers where each value is the sum of the values adjacent to it in the previous row: ...

3 years ago

Solved


Estimating Euler's (Oi-ler-z) Number
Euler's number is an irrational constant given by Starting with x=0, count the number of times you can add a uniformly distrib...

3 years ago

Solved


Where the Four Corners Am I? (Vectorized)
NOTE: this problem is intended to build on problem #55960 ("Where the Four Corners Am I?"). You may wish to solve that problem f...

3 years ago

Solved


Where the Four Corners Am I?
The "Four Corners" region of the US is where Colorado, Utah, Arizona, and New Mexico all meet - the only place where four states...

3 years ago

Solved


Next Tribonacci Number
The "Tribonacci" sequence is an extension of the idea of the Fibonacci sequence: That is, each new term is the sum of the thr...

3 years ago

Load more