Two matrices, A and B:
A = [1 2 3
9 7 5
4 9 4
1 4 7]
B = [1 2 3
1 4 7]
All rows of matrix B are members of matrix A. I wish to delete the common rows of A and B from A without sorting.
I have tried setdiff() but this sorts the output.
For my particular problem (atomic coordinates in protein structures) maintaini...
Is there a quick way (i.e. one line) to dump a collection of variables "in" a structure, using the variable names as the structure fields? The "load" function basically does this but saving and loading to a temporary file seems ugly.
For example:
clear
a = 'adsf'
b = rand(10);
x = var2struct(a,b)
x.a
x.b
or better yet:
x = var2str...
hi
I have writtring a script that convert a set of BMPs to avi. up until recently it worked fine. now I get this wierd error "Failed to write stream data". I get it after converting 5 libraries of bmps to avi. It runs over librarirs of BMPs and convert each library to avi. each time it stacks in the 6th movie.. there are no corrupts fil...
I know there is COXPHFIT function in MATLAB to do Cox regression, but I have problems understanding how to apply it.
1) How to compare two groups of samples with survival data in days (survdays), censoring (cens) and some predictor value (x)? The groups defined by groups logical variable. Groups have different number of samples.
2) Wh...
Hi there,
I'm wondering if it's possible for Neural Network to operate on matrices say I want to:
A(i)=matrix(10,10) -> B(i)=matrix(10,10)
input = vector of matrices, i = sample size
output = vector of matrices
Say I would like to guess an matrix operation transforming matrix into another matrix ie
f(A(i,j))=2*A(i,j)*b
Matlab do...
I have array say "a"
a =
1 4 5
6 7 2
if i use function
b=sort(a)
gives ans
b =
1 4 2
6 7 5
but i want ans like
b =
5 1 4
2 6 7
mean 2nd row should be sorted but elements of ist row should remain unchanged and should be correspondent to row 2nd.
...
I want to write a program that can create random collages from a given folder of pictures.
To begin, I want to create a simple collage from three images. Something like this:
I have almost no code right now
clc;
clear all;
close all;
a = imread('a.png');
b = imread('b.png');
c = imread('c.png');
% create a new image of size X x Y
...
Hi guys,
I have a bit of a problem categorizing points based on relative normals.
What I would like to do is use the information I got below to fit a simplified polygon to the points, with a bias towards 90 degree angles to an extent.
I have the rough (although not very accurate) normal lines for each point, but I'm not sure how to sepa...
hi guys, please am a student working on a project to develop a visualization tool to analyse data using an mvc design in matlab. but the problem im having is that im new to programming and matlab is the first real programing im doing. ive pretty much done the codes but i fear they are no way in an mvc design pattern so i need to change t...
Hi,
I have rectified a pair of images (applying a rotation matrix (R) to them and then projecting it to the camera image plane), done with Fusiello method/code: (http://profs.sci.univr.it/~fusiello/demo/rect/)
How can I un-rectify the image? Meaning inverse the rotation and re-project it. It would be useful, because the rectified image...
I have information (20,000 frames of data) about an audio track that I have auto-correlated using:
[r,lags] = xcorr(XX,XX,'biased');
And it looks like this:
Which hopefully is so far so good. Ideally I would like to be able to take the frame number that corresponds to the highest part of the second peak. I've read around and tried ...
We're using the MATLAB Parallel Computing Toolbox for one of our projects and we intermittently get the following error:
The client lost connection to lab 2.
This might be due to network problems, or the pmode parallel job might have errored. This is causing: java.io.IOException: An operation on a socket could not be performed because t...
Hey guys,
I could not figure out the last part of my research so if anyone could help me I would be really appreciated for the help.. :)
Say that my original matrix is,
X =
0 0 0 0 0
0 0 12 9 0
0 4 9 15 0
0 11 19 0 0
0 2 4 8 0
0 ...
Heia...
I'm trying to write the code QPSK with zeroforcing when N=2 and i got one error which i dont know how to fix it. plz help me. thanks alot
here is the code:
Modulation = 'QPSK'
Decode_Method = 'ZeroForcing'
switch Modulation
case {'QPSK'}
Symbols = [ 1+j 1-j -1+j -1-j ]';
end
Symbols = Symbols.';
nSymbols = length...
How can I get a neural net file from Matlab into a FANN .net file
...
I have a function, ranker, that takes a vector and assigns numerical ranks to it in ascending order. For example,
ranker([5 1 3 600]) = [3 1 2 4] or
ranker([42 300 42 42 1 42] = [3.5 6 3.5 3.5 1 3.5] .
I am using a matrix, variable_data and I want to apply the ranker function to each row for all rows in variable data. This is my curren...
I have a cell array where each element consists of a vector of ids. I like to compute the union of all elements in the cell array. This is my current solution, but I feel it can be vectorized or have a more elegant solution:
union_ids = union(encounter_ids{1},encounter_ids{2});
for i=3:1:numel(encounter_ids);
union_ids = union(unio...
I have a 2 vectors of numbers of either 1 or -1. What are the standard tools on Matlab that would help me calculate a correlation number between the two vectors? Thanks in advance!
...
Hello,
I am looking to create a function that could create a fade-in/fade-out function on a .wav file over a period of five seconds.
I found this code on the MATLAB forums but it seems the implementation was slightly wrong, although the right idea is there. It was for .WAV files of 300ms with a 10ms fade-in/out:
tenmssamples = length(...
Dear all,
I would like to know if there is a least squares routine in Matlab to scale a template signal to a measured signal in time. Let's say my template is a signal of approx. 1 second, but the corresponding part in the measurement is 1.2 seconds. Now I want to scale my template to be 1.2 seconds long as well. Of course it is possibl...