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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

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

más de 10 años hace | 1

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 2

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

más de 10 años hace | 1

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

más de 10 años hace | 1

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 3

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 1

| aceptada

Respondida
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

más de 10 años hace | 0

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

más de 10 años hace | 2

Respondida
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')

más de 10 años hace | 1

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

más de 10 años hace | 0

| aceptada

Respondida
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])

más de 10 años hace | 0

| aceptada

Cargar más