답변 있음
How do I find the length of string that is an object in a vector?
Words is a cell array of strings. The statement Words(1) will give you the first cell, it is a cell array of strings wit...

대략 10년 전 | 0

| 수락됨

답변 있음
How to vectorize for..loop with nested "if" and "break" statements
[x1,y1] = find(img1(Rmin:Rmax,Cmin:Cmax)==1,1,'first') and perhaps correct for the offset x1 = x1 + Rmin - 1 ...

대략 10년 전 | 1

답변 있음
how to fit a curve to 3 points automatically?
FT = fittype('a*x^2') MDL = fit(x(:),y(:),FT) MDL.a

대략 10년 전 | 1

답변 있음
fit type question for matlab
A line that passes through the original has the equation _y= a*x_ Did you try using *fittype* and *fit*? x=[-5 -4 -3 -2...

대략 10년 전 | 0

| 수락됨

답변 있음
automatically delete .m files when exit MATLAB
Could this be related to the back-up files that can be automatically created and deleted when you edit them? Take a look at your...

대략 10년 전 | 0

답변 있음
How to filter out pornographic images using MATLAB?
* Create a script that post the image automatically to Facebook * Wait for a few days * Try to retrieve the image from Faceboo...

대략 10년 전 | 2

답변 있음
Split a vector into multiple vectors based on a value in the original vector
V = [0 2 0 0 5 7 0 14 0 0 0 17 19 20] tf = V==0 ix = cumsum(tf & [true diff(tf) > 0]) Result = arrayfun(@(k) V(ix==k ...

대략 10년 전 | 1

답변 있음
How to add a new column to the beginning of a csv file using matlab
% Step 1 - Read the file M = csvread(filename) % Step 2 - Add a column to the data M = [NewColumn M] % Step 3 ...

대략 10년 전 | 1

답변 있음
How to go from a char that is a CSV to a cell array
Are you sure you want to store your data like this, i.e., all in a single cell array? Take a look at textscan to read you cvs f...

대략 10년 전 | 1

| 수락됨

답변 있음
I need to separate text from value
str = ':MEASUREMENT:IMMED:VALUE 35.0E-12' value = sscanf(str,'%*s %f')

대략 10년 전 | 0

답변 있음
create grid of squares over map using mapping toolbox
You can add a grid like this: f=worldmap([33 68],[-15 37]); geoshow('landareas.shp', 'FaceColor', [1 1 1],'DefaultEdgeC...

대략 10년 전 | 0

답변 있음
How do I set the value of the heaviside function at the origin (or shifted origin) to be 1, not 0.5?
theta2 = ceil(heaviside(t-t_origin)) which is the same as Stephens solution, theta2 = double(t >= t_origin) which...

대략 10년 전 | 0

답변 있음
Help with reading and plotting date string
Convert the dates (in variable D), using DATENUM, plot, and use DATETICK to set the x-ticks to a specific format plot(daten...

대략 10년 전 | 0

답변 있음
How can i merge two datetime columns to one
If you have stored the dates and times as cell arrays of strings, simple string concatenation would do: n.Date = {'29.02.16...

대략 10년 전 | 1

| 수락됨

답변 있음
how can i plot horizontal error bar ?
Did you search for it on the File Exchange? My very old function HERRORBAR still seems to do the job, but there might be better ...

대략 10년 전 | 0

| 수락됨

답변 있음
Hi, so I'm trying to plot this equation: y=-(sqrt(288-2*x.^4))/x with x=0:0.05:3.267 but y is giving me a single answer (-6.55) and when i do plot(x,y) the graph is empty! Can someone help me please!
The plot is not empty. It contains 66 points all having the same y value (at y=-6.5514), which can be seen here: plot(x,y,'...

대략 10년 전 | 0

답변 있음
find unique rows of cell array
One, not so elegant option: % A is your N-by-2 cell array holding arrays of doubles % convert to strings C = cellfun(...

대략 10년 전 | 0

답변 있음
how do i add output of Fx and Fxd?
What do these 5 variables in the statement " _F(row,i)= Fx + Fxd_" hold? To be added like this, _Fx_ and _Fxd_ should have o...

대략 10년 전 | 0

답변 있음
random permutation with no matches to the position
This specific type of permutation is called a *derangement*, and there are many methods to generate one. However, it is no so ea...

대략 10년 전 | 0

답변 있음
How change x axis data set to another on plot axes?
if you have axes to the handle it is easy: x = rand(10,1) ; y = rand(size(x)) ; ph = plot(x,y,'bo-') ; % ph is the gr...

대략 10년 전 | 0

| 수락됨

답변 있음
How can I calculate delta T?
Simply convert the time points to seconds TotalSeconds = second + 60 * minute + 3600 * hour Then you should take a look ...

대략 10년 전 | 0

답변 있음
how to plot the vectors having different length
You can use interpolation X_known = [1 2 3 6 8 10] ; Y_known = [2 5 6 11 18 23] ; X_desired = 1:10 Y_desired = ...

대략 10년 전 | 3

답변 있음
fprintf statement help in code
First calculate the number you want to print using size or numel (numel(..) equals prod(size(..)) NumScoresBelowCutoff = nu...

대략 10년 전 | 0

| 수락됨

답변 있음
How to delete rows from a matrix when the interval is smaller than a certain value?
I would first select the rows to keep using a loop: X = [5 90; 7 87; 12 85; 23 80; 39 72; 46 65; 58 61; 70 56; 75 50] N ...

대략 10년 전 | 1

| 수락됨

답변 있음
extracting row and column indices from MatLab matrix
You can transform linear indices into subindices, and vice versa using ind2sub and sub2ind A = [99 NaN ; 8 7 ; 1 0] Line...

대략 10년 전 | 1

| 수락됨

답변 있음
writing a formula dependant on time
Use element wise operators (.* and ./) rather than matrix operators (* and /) A = magic(2) A*A A.*A A/A A./A

대략 10년 전 | 0

답변 있음
1D array combinations
My function *NCHOOSE* will create those combinations without (slowly) looping over nchoosek. Each combination is stored in a cel...

대략 10년 전 | 2

답변 있음
How to implement a centered as well as weighted moving average on a time series data?
% TS is your time series W = [1 2 5 2 1] % relative weights smoothedTS = conv(TS, W./sum(W), 'same')

대략 10년 전 | 1

답변 있음
How can create a function with floating median?
% find MEDIAN over that time interval MyMedian{i}(j)=median(data(strt:n));

대략 10년 전 | 0

| 수락됨

답변 있음
how to fit a curve in the form of A = (L^x)(D^y)
nlm = fitnlm([L(:) D(:)], A, 'y~(x1^b1)*(x2^b2)',[0 0])

대략 10년 전 | 0

| 수락됨

더 보기