simulink model in matlab - matlab

I am working on detecting road lanes using hough transform in simulink(matlab). I have designed the model but its not detecting the lanes. As i am very new to simulink so i have no idea where i am doing the mistake. I tried to upload the model but its not working. I have used the same model as given in matlab-simulink demo except i added a new block of rgb2intensity just after the image from file block and the image which i have given as an input is also uploaded1.Any help???

Without seeing a screenshot of your actual model, it's difficult to give specific detail, but here is some general advice that you may find helpful.
I would debug a Simulink model pretty much the same way that I would debug any other piece of code -- by trying to understand exactly what is happening in my model by examining the output at each step.
For starters, I would make use of the To Workspace block, to see what the data actually looks like at the intermediate stages of your model. This will help you to identify where things are going wrong. For example, what is the output of rgb2intensity? Is this function transforming your data in the way that you expect it to? Ask that question of each block in your model if you have to. If the block is not behaving the way that you expect it to, then you can ask why?
Another tool that might be useful for you is the Simulink Debugger.

Related

Understanding a code for deep learning NOMA system in MATLAB

I'm trying very hard to understand this code about a Deep Learning-Based NOMA system based in MATLAB. I am really new to MATLAB coding but I really need to understand this entire code as it will help in my school project and I am struggling.
I think as of right now I do not need to know how the mathematical formulas work, but instead, the focus is on what the code is doing and its flow.
This is part of the code in the trainData.m file that I am struggling with right now
Why are the pilot symbols calculated and then replaced right after?
Why is the idx_sc (20) selected to be replaced? What is its significance? Is it the only subcarrier selected for the training of the DL model? Why only that?
This portion of the code in the picture is labeled "generate training data for each class". From my understanding, it is generating OFDM packets for each label, simulating the transmission and reception, and then getting the features and labels for each of the 16 classes. Is that correct?
The code and all relevant function files can be found in the link below.
Please help me understand the code!!! Please! Much thanks!
https://www.mathworks.com/matlabcentral/fileexchange/75478-deep-learning-for-signal-detection-in-noma-systems
To get you started, In lines 91 the code initializes the entire variable as 0. Subsequent lines (92-96) are just replacing pieces of the variable based on the indexing inside the “(…)”

Matlab BlobAnalysis (for cell counting)

I have been researching on how to program image processing for counting objects and I found the following homepage about Matlab for cell counting
I am not familiar with Matlab, but found their ideas interesting, so reading this, I see that they are using a BlobAnalysis Object to find the centroid of the segmented cells (You can see the image :
Now, this seem very interesting but I wonder what this operation is doing exactly? (please don't give me the definition written in the docs-"it is finding the property in the blobs". How? is it segmenting it? separating it? ) As far as I can see either you separate the cells first (that is the whole point of counting- I am doing this in other program using watersheding) and then finding the centroids is just something added and not so important, OR somehow this blob analysis is doing some interesting segmentation itself that I would like to know.
Anyone familiar with this can give me some pointers or advice here?

How do I input variables into a Simulink model through MATLAB script (SimDriveline)

For my coursework project in MATLAB, I have decided to build a drive-line model within Simulink, using the SimDriveline toolbox. The idea is to get the user to input values for the various parameters that are associated with each part of the model, such as the engine or the transmission. I would like to able to write this in a MATLAB script, but I'm not sure how to assign the values that are input to the Simulink model. For instance, the stock sdl_vehicle example that comes with SimDriveline. I am aware of the sim() command, but I am still confused on how to use it properly.
Also at the end of the simulation, the program is supposed to display the graphs that are collected in the scope window. I know that in the window itself that the scope can be printed to a figure, but is it possible to print that scope to a figure through MATLAB script?
This is the first time I have ever used a program like MATLAB. I would appreciate any help I could get, many thanks in advance!
There is a simulink block called simin:
http://de.mathworks.com/help/simulink/slref/fromworkspace.html?searchHighlight=simin
I used it some days back and it worked quite well. You can use the block in your model and define some signals/varibles as input.
After that you may write a Matlab-Script with an input function to set all the previous defined input values.

MATLAB: How to Retrieve Intensity-Based Registration Data (with imregister) to re-Perform Registration?

I thought this should be a simple task, I just can't find the way to do it:
I am using 'imregister' (MATLAB) to register two medical X-ray images.
To ensure I get the best registration outcome as possible, I use some image processing techniques such as contrast enhancement, blackening of objects that are different between images and even cropping.
The outcome of this seems to be quite satisfying.
Now, I want to perform the exact same registaration on the original images, so that I can display the two ORIGINAL images automatically in alignment.
I think that an output parameter such as tform serves this purpose of performing a certain registration on any two images, but unfortunately 'imregister' does not provide such a parameter, as far as I know.
It does provide as an output the spatial referencing object R_reg which might be the answer, but I still haven't figured out how to use it to re-preform the registration.
I should mention that since I am dealing with medical X-ray images on which non of the feature-detecting algorithms seem to work well enough to perform registration, I can only use intensity-based (as opposed to feature-based) registration, and therefore am using 'imregister'.
Does anyone know how I can accomplish this?
Thanks!
Noga
So to make an answer out of my comment, there are 2 things you can do depending on the Matlab release you are using:
Option 1: R2013a and earlier
I suggest modifying the built-in imregister function by forcing tform to be an output and save that function under another name.
For example:
function [movingReg,Rreg,tform] = imregister2(varargin)
save that, add it to your path and you're good to go. If you type edit imregister you will notice that the 1st line calls imregtform to get the geometric transformation required, while the last line calls imwarp, to apply that geometric transformation. Which leads us to Option 2.
Option 2: R2013b and later
Well in that case you can directly use imregtform to get the tform object and then use imwarpto apply it. Easy isn't it?
Hope that makes things clearer!

simulate ARMA model with specific order and parameters value

What is the matlab function to simulate ARMA model and coda matlab function
(coda:convergence diagnostic and data analysis)
A friendly suggestion: even normally helpful people will probably get annoyed if you ask too many similar questions without indication that you're willing or able to do some work yourself. A better question might start with something like: "I tried x but it didn't work for reason y.."
As before, the Systems Identification Toolbox may have what you need.