Click here to Skip to main content
15,891,762 members
Everything / MatLab

MatLab

MatLab

Great Reads

by n.podbielski
Using Matlab from a C# application
by dcmuggins
Breif tutorial on how to convert an RGB image to grayscale within MatLab
by JinWenQiang
This tip is a brief introduction of Network Calculus. I used Matlab codes to show you the results and to explain how it works.
by Roozbeh Abolpour
The data-driven MPC is implemented in this project that can be easily exploited

Latest Articles

by Member 4206974
The article is about Matlab - Octave scripts for easy create forms with the most useful controls (texts field, lists, radio buttons, check boxes, sliders, ...)
by Roozbeh Abolpour
The data-driven MPC is implemented in this project that can be easily exploited
by Huseyin Atasoy
An image classifier / tagger based on convolutional neural networks. Now more than 10 times faster with the Intel MKL support.
by Mahsa Hassankashi
Best practice for learning Basic of Machine Learning and Gradient Descent based on Linear Regression. This article will explain step by step computational matters.

All Articles

Sort by Updated

MatLab 

11 Dec 2023 by ann1988425
matlab Yr=Y; Us{1}=Yr*C; U=Us{1}; Fxy=Y-Us{1}*C R Yr
10 Dec 2023 by Kenneth Haugland
Have you tried to type "format long" in matlab? What you see in matlab and what is saved might be two different things
21 Jul 2023 by Graeme_Grant
Did you try asking in the official Answers[^] forum? It's the equivalent of CodeProject's Quick Answers[^] (where this question is posted) except it is purely Matlab where you should get good support. Here is the link: MATLAB Answers - MATLAB...
21 Jul 2023 by Kiana Mahtabi Nourani
clc clear all close all % Define the directory where images are located imageDirectory = 'C:\Users\acer\OneDrive\Desktop\benign'; % Get a list of all folders within the directory folders = dir(imageDirectory); folders =...
2 May 2023 by SUDIPTA MUKHERJEE 2023
.The transmitted signal is single carrier with root raised cosine filter. • Filter coefficient is 0.3 • Modulation: BPSK • OSR: 16 in the recording (TDMA125KHzSpan.mat) The signal has replica of m-sequences (m=6) as training one in the front the...
29 Apr 2023 by Member 8840306
I am new in using tensorflow keras using python.I am trying to run this statement in Jupter Notebook import matlab.engine It is givng this error ModuleNotFoundError: No module named 'matlab.engine'; 'matlab' is not a package For...
29 Apr 2023 by Richard MacCutchan
The relevant messages are: FileNotFoundError: [WinError 2] The system cannot find the file specified // and RuntimeError: MATLAB installation not found in Windows Registry: [WinError 2] The system cannot find the file specified And the...
12 Dec 2022 by All Yasser
Transfer a new matrix of elements in the given matrix as 3 elements. What I have tried: Transfer a new matrix of elements in the given matrix as 3 elements.
23 Nov 2022 by Farid Bagheri
I am new in coding and my professor asked me to do a project about Risk at value(VaR) but unfortunately, I wasn't able. Is there anyone to help me with this issue? I need to convert this MatLab code into Python code ...
19 Nov 2022 by Richard MacCutchan
Sorry, but this site does not provide code conversion services. If you want help with your problem then you need to show the code that you have written and explain what problem(s) you see and where it/they occur.
7 Nov 2022 by farhad afra
I am looking for a code that finds the edges of the image without using pre-prepared commands. What I have tried: I am looking for a code that finds the edges of the image without using pre-prepared commands.
28 Sep 2022 by Moharram
hi I want to implement Matlab ismember function in C++ or Delphi, but the result is more time consuming than Matlab result! is there any idea? thanks What I have tried: As I said, the Matlab output is more faster than my implementation in...
23 Sep 2022 by merano99
After multiple timings with 64 bit release code, I get times between 3us and 4us for the example. I would be interested to know if the C++ solution takes longer and secondly how long Matlab takes. Here is my test program call with the...
27 Jun 2022 by Dino Rawr
The output i get is black image . Why ? Which part is incorrect? What I have tried: i=imread('flair.jpg'); [m,n]=size(i); i2 = zeros(size(i)); for y =1:m for x=1:n if i(y,x) >= 0.2 && i(y,x)
27 Jun 2022 by Amarnath S
Add this line i1 = im2double(i); as the third line. Then modify your if loop to handle i1. The image is an 8-bit image, having values from 0 to 255, and there are no values in the range 0.2 to 0.7. You need to convert it to a double image,...
23 Jun 2022 by pollie 2022
I need to change the output of this while loop code into a pyramid of asterisks. However, I am confused because I made a Christmas tree-like pyramid. ____* ___* * __* * * _* * * * * * * * * p.s. kindly treat underscores as spaces What I have...
23 Jun 2022 by CPallini
Do you mean this? rows = 5; r = 0; while r = -r) && (x
23 Jun 2022 by Patrice T
Quote: How can I change this to a pyramid? Look carefully at your pyramid: ____* ___*_* __*_*_* _*_*_*_* *_*_*_*_* There is more spaces than what you seems to think.
23 Jun 2022 by Richard MacCutchan
This is just a matter of counting, as you can see from your example picture. The final line is five stars, the previous line is one space and four stars, etc. So from the pattern it should be easy to calculate how many of each character you need...
15 Jun 2022 by raamsa
I have impulsive differential equation. I want to code them in octave. What I have tried: clc; clear all; close all; % step sizes t0 = 0; tfinal = 5; h = 0.01; n = ceil((tfinal-t0)/h)+1; %initial conditions s(1) = 0.5; theta = 0.01; N0 = 2;...
10 Jun 2022 by Member 15659476
#include #include // odeint function definitions using namespace std; using namespace boost::numeric::odeint; // Defining a shorthand for the type of the mathematical state typedef...
10 Jun 2022 by merano99
The Matlab documentation under de.mathworks.com/help/matlab/ref/ode45.html states: The time step chosen by the solver at each step is based on the equation in the system that needs to take the smallest step. This means the solver can take small...
30 May 2022 by Ahmad M 2022
Write a MATLAB program to design Type -1 Chebyshev filter with given specification and plot its response (5 Points) a. Pass band Ripple = 0.25 dB b. Stop band attenuation = 10 dB c. Pass band edge frequency = 400Hz d. Stop band edge frequency =...
30 May 2022 by Dave Kreskowiak
Nope. That's not how it works. If you want someone to do your work for you, go to Freelancer.com and get out your credit card.
22 May 2022 by mohade3 ensafi
I want to create an Arc path over 3 points in 3D space. I decided to draw a circle over them and then extract sector from p1 to p3 that passes through P2. circle equation is: fc = @(a) center + cos(a).*(q1-center) + sin(a).*(q2-center); ...
6 Apr 2022 by thisisjinesh
I have following data from which I need to create coon's patch. I need to code in Matlab Matrix of polygon vertices given below P0u = [0,0,0; 0.2357,0.2357,0.3333; 1.1785,0.2357,0.3333; 1.4142,0,0]; P0w = [1.4142,0,0; 1.1785,0.2357,0.3333;...
29 Mar 2022 by Testing Su
Hi readers :), I read this article at Genetic Algorithm: General Concept, Matlab Code, and Example[^] . Basically, the genetic algorithm code used in this case is from an output given, it can predict the 2 different variables. For example, if I...
29 Mar 2022 by Andy Allinger
There's 2 big obstacles here you will have to face: First, 3*x + 2*y = 5 is underdetermined. Choose any x, and there is a y that will satisfy the equation. The genetic algorithm is for optimization. You need to pose this as an optimization...
11 Mar 2022 by Harsh Brar
lets say we have the equation t = 122.14-0.84.*x(1)-0.42.*x(2)+0.34.*x(3)-0.09.*x(4)+363.77.*x(5); It have 5 variables and have some lower and upper bounds. i perform genetic algorithm and got optimum values as answers. now whatever value I...
9 Mar 2022 by JamesDorr
Can you help me with this in Matlab I have this matrix A= 10 20 30 40 60 70 80 90 100 B= 1 1 1 1 1 1 how can i add matrix B into the end of matrix A to look like this C= 10 20 30 40 60 70 80 90 100 1 1 1 What I have...
9 Mar 2022 by Arthur V. Ratz
Here's the solution: And, this is done in MatLab just like in Python and NumPy, such as: For rows: A = ones(1,4); B = zeros(1,4); C = [A B] D = [A;B] For columns: A = ones(2,3) B = zeros(2,2) C = [A B] I basically refer to Creating,...
3 Jan 2022 by Member 15487602
HI hi I am trying to solve two partial differential equation by converting it first into ODEs using finite difference and using ODE15s solver,but getting some error, pl help What I have tried: clc clear all m=50; delx=1/(m-1);...
10 Nov 2021 by Richard MacCutchan
DYOR: TCP/IP Socket Communications in MATLAB - File Exchange - MATLAB Central[^].
30 Aug 2021 by Member 4206974
The article is about Matlab - Octave scripts for easy create forms with the most useful controls (texts field, lists, radio buttons, check boxes, sliders, ...)
9 Aug 2021 by hassan nabi
I want to bring MATLAB code in Python without coding. Is there an app؟ What I have tried: I just think the solution is to rewrite it But I want to know if it is possible to convert without coding?
9 Aug 2021 by Richard MacCutchan
See How to convert the MATLAB code into the Python? - MATLAB Answers - MATLAB Central[^]
9 Aug 2021 by OriginalGriff
No, it's not possible without rewriting. Matlab and Python operate in completely different frameworks, and what works well in one is difficult or clumsy to implement in the other. Use the Matlab code as a specification for what the Python code...
28 Apr 2021 by oussama said
I'm working on a project where I have to define an optimum size of a warehouse and I found that the Heargu method as a heuristic could be useful for me in that case. so I'm about to look for a code on Matlab which illustrate that heuristic, and...
28 Apr 2021 by OriginalGriff
Quote: Still not find any code about it Then write some. Go back to where you found the information on it, and read it again. Think about how it works, and what you need to do to implement it. Development isn't about finding existing code and...
22 Apr 2021 by Member 14991075
I have one directory with many folders. Each folder contains a .txt file (eg, file1 contain number1.txt, file2 contain number2.txt etc). these files has 4 columns with double numbers. Also I have, outside of this directories one matlab code...
31 Mar 2021 by Tanvir Allidina
I have a range of vectors which are P1,P2,P3 and I would like to write and if statement that if a certain vector is selected a corresponding matrix is selected. for example if the user puts into the function P1 the corresponding output WP1 will...
31 Mar 2021 by CHOLLAPAT CHOU
I am trying to model a PV system connected to electrical grid and try to connected BESS with the system. I try to connected BESS via bi-directional so Battery can charge and discharge. What I have tried: I have try this following model on...
31 Mar 2021 by Richard MacCutchan
Quote: I don’t think the result is correct. So what exactly do you expect from this site? Which is, incidentally, for specific programming questions as described at Code Project Quick Answers FAQ[^].
15 Feb 2021 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
29 Jan 2021 by Member 14991075
I would like to set spesific numbers to letters of the alphabet. I have tried a code but this code set numbers to letters and accordeing to numbers returns spesific letters. I would like to create a code that will return numbers based on spesific...
29 Jan 2021 by OriginalGriff
See here: Find strings within other strings - MATLAB strfind[^]
29 Jan 2021 by Anonymous197
The program you create needs to: Able to enter the teams name Able to record the score data for 5 tries Able to visualize the recorded data Can analysis the data recorded Can interpolate the score for every 0.5 tries My problem is that it...
29 Jan 2021 by Richard MacCutchan
parse error near line 22 of file /home/jdoodle.m syntax error >>> y=[A(1)A(2)A(3)A(4)A(5)]; ^ Not too difficult to see.
29 Jan 2021 by OriginalGriff
This is the same "question" you posted yesterday: I need to create a program that can be used to record a game results[^] and the answer hasn't changed. Your teacher didn't like your homework, you are supposed to do it again and better. That...
28 Jan 2021 by OriginalGriff
Quote: I need another code better than this one my prof. Asked me to create a new better one And the operative word there is "you". We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for...
4 Nov 2020 by raddevus
[0.91, 0.81, 0.72, 0.74, 0.33, 0.85] [0.91, 0.81, 0.72, 0.74, 0.33, 0.85] [0.91, 0.81, 0.72, 0.74, 0.33, 0.85] [0.91, 0.81, 0.72, 0.74, 0.33, 0.85] [0.91, 0.81, 0.72, 0.74, 0.33, 0.85] now iterate through each row and each column for row = 0...
4 Nov 2020 by justilian
New programmer here, I got a task to make a program that picks and displays number of numbers greater than 0.8 in a random matrix 5x6 with 2 for loops and would appreciate help if someone knows how to make it. Thanks in advance. this is how...
18 Oct 2020 by Roozbeh Abolpour
The data-driven MPC is implemented in this project that can be easily exploited
16 Oct 2020 by KRS Cristian
Hi guys, I have a .bat file and a want to execute it when a I press a specific Buton from a window. Eg. When a press the yes button from a dialog box I want the .bat file to execute the command inside. Thanks! What I have tried: I want to try...
16 Oct 2020 by raddevus
You've mentioned no context for the button that you're clicking. I'm assuming it is a winform or something because I see you've marked as C++. So, you can use ShellExecute win api[^]
9 Sep 2020 by Richard MacCutchan
This is the same issue as Select cell e.g: row 1 col1[^]. Please do not repost.
8 Sep 2020 by Sandeep Mewara
A similar discussion with accepted solution: Programatically selecting cells in a uitable - MATLAB Answers - MATLAB Central[^] How to select/highlight a cell/row in the uitable programmatically? - MATLAB Answers - MATLAB Central[^] % m =...
8 Sep 2020 by maria99
Hi guys , how would i programaticaly select cell , e.g: highlite row1 col1 in a uitable in matlab ? What I have tried: i have tried some codes but they didnt worked
2 Aug 2020 by Member 14904647
Hi I want to do feature extraction from an image. I read a paper and did this steps: I did image segmentation. Then I want to do feature extraction. In this paper: Segmented lungs were divided into 3*3 windows in which all nine pixels were...
2 Aug 2020 by Gerry Schmitz
I'm guessing one random pixel out of the 9 in a 3x3 cell (otherwise you would just use a different cell size.) The confidence factor is related to how many 3x3 cells in a lung; and what the training data contains. Can't just test with 3x3. Need...
31 Jul 2020 by franciskane
I'm helping a friend in developing a project for our alma mater. And its based on this paper. based on this paper: (PDF) An Enhanced Indoor Positioning Method Based on Wi-Fi RSS Fingerprinting[^] and inside this paper their is this algorithm...
31 Jul 2020 by Richard MacCutchan
Any programming language would be acceptable. The difficulty is actually coding the algorithms to an acceptable level of accuracy and reliability. But that is what testing is for.
31 Jul 2020 by Sandeep Mewara
Quote: My question is can PHP or JS or Python be used as a substitute for MATLAB? AFAIK and a quick reference on web, seems Python is a viable option for MATLAB replacement. Refer detailed reference here: MATLAB vs Python: Why and How to Make...
20 Jul 2020 by Member 14891535
How can I let Matlab automatically input the file itself rather than one by one myself? I mean, I want to put `Sample 1.wav` and then output `Sample 1.png` and then put `Sample 2.wav` and then output `Sample 2.png` and then put `Sample 3.wav`...
18 Jul 2020 by Member 14891535
You Retrieve sensor data from a specific REST endpoint are required to produce a software solution, using the programming language of your choice, to address the following requirements: • . This would be achieved by using a HTTP GET issued...
18 Jul 2020 by Richard MacCutchan
As I have finally figured out the format of the data and how to decode it I offer the following: # decode the response from the REST service restjson=json.loads(httpresponse) # get the string of sensor data rawblob=restjson[0]['blobJson'] #...
17 Jul 2020 by Richard MacCutchan
This is the same question as How to retrieve only the first 2 data from a specific REST endpoint (no the entire data) Python[^], which you posted yesterday. And I already gave you a suggestion for how to extract the data. In fact this is the...
17 Jul 2020 by KarstenK
Ofcourse you should continue, but best is to get clear about which language you want to use. You better ask which libraries are recommended for that task, so you have some proper database, networking and ui tools. But anyway - it is your task....
17 Jul 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
11 May 2020 by Huseyin Atasoy
An image classifier / tagger based on convolutional neural networks. Now more than 10 times faster with the Intel MKL support.
3 May 2020 by phil.o
linear regression matlab[^] will give you plenty of material to start with.
29 Apr 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
29 Mar 2020 by hinaiqbal
I have array as A=cell(4,1);A=[1;2;3;4]; i have to increase the size of A. i.e to make it 8 for example. when i pad the zeros or simply vertically concatenate the two array(one is A and other is simply e.g B=cell(4,1))I get the answer like [4x1 double][][][][] whereas i...
28 Mar 2020 by Member 14785449
clc clear image=imread('unnamed.jpg') imshow(image) r=image(:,:,1); g=image(:,:,2); b=image(:,:,3); imshow(r); figure,imshow(g); figure,imshow(b); imshow(image); figure figure,imshow(image);
28 Mar 2020 by boofi
I have a project to track objects based on their color. I need to know how to get the color map or color code. What is the definition for the color blue or green? Thank you. :)
20 Feb 2020 by phil.o
You can have a look at MATLAB GUI - MATLAB & Simulink[^]
20 Feb 2020 by labrami
hello i need to create a graphical interactive interface that it can show the result everytime i insert new parameters This tool will help me to take decision. What I have tried: i tried some tricks in matlab but without good result so i need...
9 Feb 2020 by Alber Longa
hi. i am looking for matlab code for curvelet transform or some one tell me how to proceed for its implementation in matlab????
7 Feb 2020 by matlabprozhe1
Hello i wrote a code related to the rate of sex diagnosis using neural network and image processing But can't figure out someone's age using a person's face? What I have tried: Hello i wrote a code related to the rate of sex diagnosis using neural network and image processing But...
13 Jan 2020 by gcogco10
Hi Team I am creating an email using Matlab Analysis to my Thingspeak channel. Now i am getting this error " Specify a valid read API key, or make the channel public to avoid specifying the read API key. ". My channel is set to private for now and dont want to change it to public channel. What...
13 Jan 2020 by ZurdoDev
As mentioned in the error, you either need to access it with a Read API key or make it public. From the comments, it sounds like you made it public.
12 Jan 2020 by phil.o
Most probably, replace avg_temperature with aveTemp; but it's just a wild guess. If this does not solve the issue, then you will have to explain with more details where and how you did define the avg_temperature variable. If you have copied part of this code from somewhere without trying to...
12 Jan 2020 by gcogco10
Hi Team I have this code below and my channel is set to public and now i am getting unrecognized function or variable using 'avg_temperature'. Anyone who can help me with this issue? What I have tried: data = thingSpeakRead(929272, "NumMinutes", 100); aveTemp = mean(data(:,7)); apiKey =...
25 Nov 2019 by Esraa Saady
i create a function in matlab called segment, and i want to call it from c# programit takes 2 argument "string and integer"and it returns 6 arrays this is my code : var activationContext = Type.GetTypeFromProgID("matlab.application.single"); var matlab =...
8 Nov 2019 by Richard MacCutchan
mittal-kumari algorithm - Google Search[^].
8 Nov 2019 by Luigi Volpe
hi everyone, I'm new on this platform. I want to know if the mittal-kumari's algorithm in Matlab for Age-Related Macular Degeneration is available? What I have tried: I tried to search here but I didn't find anything.
5 Nov 2019 by gcogco10
I am struggling to communicate with my plugin button, i am using thingspeak channel and have a channel that has a field. I am struggling to send a request on a client side in jquery, as i am using 'GET' method. What I have tried:
4 Nov 2019 by Maciej Los
I'd strongly suggest to ask this question on Matlab forum: Home - MATLAB Central[^]
4 Nov 2019 by Khaled Bheri
hi. i m working on a project which is related to digital image processing but i can't count the overlapped objects it take multiple overlapped objects as one object. please tell me which method i can use for this problem.... and overlapped objects may be two or more than two..... so please tell...
13 Oct 2019 by Member 14621368
Hi What is Octave's alternative to MATLAB's pointCloud()? What I have tried: i have searched online and looked into Octave's documentation but Nothing i can do so far.
13 Oct 2019 by Richard MacCutchan
octave vs matlab - Google Search[^].
27 Sep 2019 by Shailendra Saxena
currently we are working on this project. As name suggests that we are detecting the tumor from MRI images and classifying Astrocytoma type of brain tumors. plz suggest how to get the mri image ?
13 Aug 2019 by Parth_k
I trying to develop a program using neural network to solve any real-life problem. so, I took retinopathy detection using Probabilistic neural network using MATLAB. I took some help from professor and developed the program. I have trained the neural network and created the dataset but when...
28 Jul 2019 by Member 14541751
The first question is as follows: Complete the script in Octave so that it defines the following 5 vectors. Each row describes the measurements of activity of all 25 genes at one time point. [10 marks] T1 = [1, 4, 3, 100, 12, 1000, 25, 32, 500, 700, 20, 9000, 25, 650, 40, 3, 67, 2, 305, 80,...
28 Jul 2019 by Member 14541751
I have to produce a 5x25 matrix in which the rows represent time and columns represent the activity at those times. What I have tried: I have tried the usual semi-colon approach
28 Jul 2019 by Member 14541751
sorry guys, im new to all this, i have posted the first question and also my response?
25 Jul 2019 by Member 14541751
Thank you, although its not coming out as a even matrix :(
25 Jul 2019 by CPallini
According to the documentation[^], your approach is correct. A little test (2x25 matrix) on my Linux box: >> M = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25;26,17,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50] M = 1 2 3 4 5 6 ...
13 Jun 2019 by Member 14499512
i have a map that shows magnetic field strength and it uses a color scale so that when the colour is red on the map this means that the magnitude is approaching positive maximum and if its green then its close to 0 and when it gets to blue its approaching negative infinity, and i am looking for...