Beantwortet
Breaking up a computation vs "..." to continue line - Huge Speed Difference !?
I don't think it has anything to do with "...". Shot in the dark: Cache locality? Maybe big_expression(n) and big_expression(...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
deleting multiple rows in a matrix
your_mat = your_mat(113476:end,:); Please read the Getting started part of the documentation.

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
How to combine this R, G, B values of an image so that i have an image?
your_image = cat(3,R,G,B);

mehr als 13 Jahre vor | 3

| akzeptiert

Beantwortet
how can i make a storage in simulation for matrix ?
You should probably use a cell array: my_result = cell(1,k); for ii = 1:k my_result{i} = ssvs(e,y,q,m,k); end ...

mehr als 13 Jahre vor | 0

Beantwortet
Creating a function with a logical output.
It does return logical for me. What does class(TLU(rand, rand, rand)) return? If *ans* returns something different, y...

mehr als 13 Jahre vor | 0

Beantwortet
How can i do optimization in matlab?
Are you sure you asked the right question? If so, what you are asking is: y-x = at; %Find a and t Since y and x are known...

mehr als 13 Jahre vor | 0

Beantwortet
Codistributed arrays taking too long to run
It's because even though you distribute your array amongst the workers, matrix multiplication might not be efficient, depending ...

mehr als 13 Jahre vor | 0

Beantwortet
another quick question about string read
*EDIT* sprintf('%s_%d', 'modelsq', gesNum);

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
How can I draw hysteresis loop using matlab
x = rand(10,1); y = rand(10,1); quiver(x(1:end-1),y(1:end-1),diff(x),diff(y),0); Please accept an answer if it helps yo...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
quick question about string read
load(a1);

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
how to interface using shape file data in matlab?
doc shaperead

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Passing Functions and m-files to functions
myStr = 'P1.m' function [result] = myFun(someArg, myStr) [str str] = fileparts(myStr); run(str); %calling...

mehr als 13 Jahre vor | 0

Beantwortet
Apply a mask to 4D medical images in a vectorized way
data = rand(144,144,12,25); your_mask = rand(144,144) > 0.5; Assuming you want to multiply by the mask: your_result = ...

mehr als 13 Jahre vor | 2

| akzeptiert

Beantwortet
Creating a char matrix
your_mat = repmat('31T',15443,1); Note that the dimensions of this array will be 15443 times 3 (the number of characters in...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
ommiting blanks in a string
your_array = char(randi([32 127],100,10)); for ii = your_array' sub_set = ii(ii ~= char(32))' end

mehr als 13 Jahre vor | 0

Beantwortet
variables in m files
function [A B C] = ImAFunction(d,p,t) FC = 360; d = hex2dec (d); p = hex2dec (p); t = hex2dec (t); A = (d*0...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
error using the example script of PCA
data = imread('result.png'); data = bsxfun(@minus,data,mean(data,2)); Note that this will not solve your problem, as the...

mehr als 13 Jahre vor | 0

Beantwortet
Declare equality in Symbolic Math Toolbox
You could do like this: syms z x1 x2 x3 x4 eqs = [-z+x1+x2; -z+x3+x4; x1+x2-x3-x4]; solve(eqs) But it is rather point...

mehr als 13 Jahre vor | 0

Beantwortet
Hi, Can anyone tell me how to find average of three successive values in matlab, i have an array of 200 values
your_vals = randi(100,1,200); filterLength = 3; %One option your_result_1 = conv(your_vals,ones(1,filterLength)./fi...

mehr als 13 Jahre vor | 0

Beantwortet
Custom output of the fprintf
Here is a small script to do what you asked for: val = -0.0000001245332; %for example tempVal = abs(val); ord...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Chi squared test to test if data is from same distribution
You could use a two-sample Kolmogorov-Smirnov test. This tests the hypothesis that the two samples come from the same distributi...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Series generated by recursive formula
You could always write a recursive function, but I would much rather use the for loop as it is much simpler to understand, IMO, ...

mehr als 13 Jahre vor | 0

Beantwortet
Finding maximum and minimum values of an array by specifying the range.
Using _accumarray()_, assuming _data_ is a two column array where the first column is Matlab's serial date number: idx = flo...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Creating a static library using the .mex command
That would depend on the compiler you use. Just compile some object files ( _/c_ option for visual studio, _-c_ for gcc). Then y...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Extracting data from a structure
I am not sure I understand your question. But if what you mean is that you have a cell array of structures and that you want to ...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Import binary data to array
status = fseek(fid,3,'bof');

mehr als 13 Jahre vor | 0

Beantwortet
Add rows to txt file in order to create a matrix
Saving the permutations one by one as they are generated sounds very inefficient due to i/o overhead. It is probably best to sav...

mehr als 13 Jahre vor | 3

| akzeptiert

Beantwortet
Using sign(x) with -0.00?
your_mat(abs(your_mat) < 100*eps) = 0; %or some other limit

mehr als 13 Jahre vor | 0

Beantwortet
means of a number of rows
data = rand(86400,4); your_data = reshape(data,1800,[],4); your_data = permute(your_data,[1 3 2]); your_average = squ...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
getting plot projection in 3d
aH = axes; your_data = randn(1000,3); oneMat = ones(size(your_data,1),1); plot3(your_data(:,1),your_data(:,2),your_da...

mehr als 13 Jahre vor | 1

Mehr laden