已回答
Efficiently multiplying diagonal and general matrices
The best solution is going to depend on what your m and n actually are (if you know representative values of them, you should in...

11 years 前 | 1

| 已接受

已回答
Efficiently multiplying diagonal and general matrices
M = randn(10000,10); D = diag(randn(10000,1).^2); tic A = M'*D*M; toc tic B = bsxfun(@times,M,sqrt(dia...

11 years 前 | 0

已回答
diagonal pixel differences of image matrix
b = [2 1 8 24;9 10 3 12;2 5 8 19;1 2 3 4]; conv2(b,[-1 0; 0 1],'valid')

11 years 前 | 1

已回答
ODE with diff? DE in x(t), w/ forcing y(t), where y'(t) also appears.
It might seem counterintuitive, but even though y'(t) appears in the ODE, you don't actually need to calculate it. No DIFF, no G...

11 years 前 | 1

已回答
The advantages of MATLAB over other programing languges for Image Processing
I'm sure I've left a bunch of stuff off this list, but this is what I got off the top of my head. * A very large (and growing...

11 years 前 | 2

已回答
minimum row value and return the row
Do you mean to say, you want the row with the minimum maximum value? A=[12 64 76; 34 10 27; 9 8 20; 10 30 8]; [value,ind...

11 years 前 | 2

| 已接受

已回答
Generate Y from the conditional f(y|x)
If your goal is to generate points with that 3-dimensional PDF, then I think it could be done a bit simpler without having to do...

11 years 前 | 1

| 已接受

已回答
Why isn't the autocorrelation of rand a delta function?
As described in detail here, <http://en.wikipedia.org/wiki/Autocorrelation>, there is more than one convention when calculating ...

11 years 前 | 1

| 已接受

已回答
Splitting an axis into a linear and log scale
I don't think there's an easy way to do it, but you might be able to piece together two axes to make it look like its half linea...

11 years 前 | 4

| 已接受

已回答
Finding vertices of (large) linear program feasible region
For the k-th direction, the set of possible edge points is b./A(:,k) along with +/-Inf. So test each one in order to see if it i...

11 years 前 | 0

| 已接受

已回答
Integral with scalar input
For an integrand that can't accept vector inputs, but only take scalar values one by one, you actually need to set ArrayValued t...

11 years 前 | 1

| 已接受

已回答
In MATLAB (cumulative distribution function), how can I find the corresponding data point (Y) for any chosen cumulative probability?
Alternatively, you can use ICDF directly on the probability distribution object icdf(pd,[0.2 0.466])

11 years 前 | 0

| 已接受

已回答
Nesting parentheses issue: any workaround?
I am in agreement with Jan. I cannot recall a single instance where I needed to use 32 parenthesis for anything. If you really n...

11 years 前 | 0

已回答
Fit a piece-wise linear function to data: fitting 2 lines to data and finding their corresponding parameters
You data doesn't really look like it has a constant trend at the beginning. In any case, you should still be able to solve it wi...

11 years 前 | 0

| 已接受

已回答
Find row in matrix, fast and with special conditions
Not sure if this is faster, but might be worth a try. d1 = 12650; d2 = 4; S = randn(d1,d2); s = S(randi(d1),:); ...

11 years 前 | 0

已回答
multiplication table in matlab
N = 10 (1:N)'*(1:N)

11 years 前 | 4

已回答
How to calculate the cumulative value by consequetive hours
data = [1 2 3 4 5 6 7 8]; for n = 2:5 conv(data,ones(1,n),'valid') end This gives me: ans = 3 ...

11 years 前 | 1

已回答
Perfect random numbers - How can I refine an initial dataset from randn to be perfrectly normal?
If you want to generate a set of numbers that "looks random", has 0 mean, 1 variance, 0 skewness, 3 kurtosis, you can start with...

11 years 前 | 2

已回答
L1 Optimization in matlab
Make some d and F just to test it. d = [1;2;3;4;5]; F = [.1 .3 .5 .7 .9; .2 .4 .6 .8 1.0]; I can think of two ways. ...

11 years 前 | 0

| 已接受

已回答
how can we represent the histogram of a vector without using the hist function ?
Is it that you just don't want the bar graph that comes up with HIST? If you call it with output arguments, you can get the valu...

11 years 前 | 0

已回答
Taking weighted means over matrices with missing data
M = [4 NaN 1 NaN; 5 3 8 NaN; 1 6 2 4; 8 4 7 2]; w = [0.4 0.3 0.2 0.1]; W = bsxfun(@times,~isnan(M),w); W = bsxfun(@...

11 years 前 | 0

已回答
Get rid of nested for loops?
A few observations: 1. A lot of the operations you are doing can me written more efficiently as matrix operations (dot prod...

11 years 前 | 4

| 已接受

已回答
How to find zero elements in a three dimensional matrix whose neighbors are all zero.
As you guessed, there are much simpler ways to do it using image processing techniques. % Just making some random data to w...

11 years 前 | 0

| 已接受

已回答
Intersection of Two Implicit Curves over a domain
This sort of problem can be solved easily using FSOLVE circ = @(x,y) x^2+y^2-4 elp = @(x,y) ((x-2))^2+((y+2)/4)^2-1 ...

11 years 前 | 0

| 已接受

已回答
while loop in matlab password GUI
In your GUI case, the reason it displays 'a' after just one failed attempt is, this loop: username1= 'xxx'; password1= '...

11 years 前 | 0

已回答
How to calculate conditional sum of a part of vector/array based on a 2nd one
Just for comparison, here is a FOR loop solution. FOR loops can actually be very fast, even for large arrays, especially when yo...

11 years 前 | 1

| 已接受

已回答
Negative gain and phase margin, yet a stable and robust system... can somebody explain?
When I try that, I get something completely different. How are you defining your P and C? s = tf('s'); P= 1.429e-07*1/(s...

11 years 前 | 1

| 已接受

已回答
How to create a boxplot from a PDF?
How about something like this. Generate the CDF from your data as Tom suggested, invert it, use the inverted CDF to generate a ...

11 years 前 | 1

| 已接受

已回答
Values of intersection points of plot. Print results.
If your x is the output of an ODE solver, then it might not hit x2 = 1 exactly and you will need to interpolate. You could us...

11 years 前 | 3

| 已接受

已回答
Large Sparse Matrix Summation
This seems to work well: % Making some random data... N = 1000; K = 100; A = sprand(N*K,N,0.0001); [r,c,val...

11 years 前 | 2

| 已接受

加载更多