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

oltre 13 anni fa | 1

| accettato

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

oltre 13 anni fa | 1

| accettato

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

oltre 13 anni fa | 3

| accettato

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 1

| accettato

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

oltre 13 anni fa | 0

| accettato

Risposto
quick question about string read
load(a1);

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 2

| accettato

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

oltre 13 anni fa | 1

| accettato

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

| accettato

Risposto
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, ...

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 3

| accettato

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

oltre 13 anni fa | 0

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

oltre 13 anni fa | 0

| accettato

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

oltre 13 anni fa | 1

Carica altro