Quantcast
Channel: MATLAB programming & numeric computing platform
Viewing all 31061 articles
Browse latest View live

I want to start learning Matlab. Is it essential? I’m an EE and in my third year as well. Can I do without it?


MATLAB IMAGE ANALYSIS QUESTION

Matlab code saying "Error using textscan"

quick question regarding matrixes please

$
0
0

how to add this 3 matrixes to get the overall mean

I have;

x=[4.56, 5.12, 4.90, 5.07, 5.85];

y=[4.75, 4.69, 4.87, 4.78, 4.46];

z=[4.62, 5.08, 5.07, 5.00, 4.93,];

i would like to add all of those numbers and divided by 15 to get an overall mean.

thanks!

submitted by /u/AwayLiftoff
[link] [comments]

Need help pointing in the direction of mathematics in the code

Quick question on image filetype used in fasterRCNN object detector

$
0
0

Hey guys, I am currently in the process of creating an object detector. The ground truth table I am creating to input into the training for this detector is compromised of images which are of .jpg and .jpeg file types. Will the fact that my dataset consists of different file types affect the training or yield any errors?

submitted by /u/HandyRevolver
[link] [comments]

Arduino won't connect with simulink

$
0
0

I try to connect my arduino nano (not original) to simulink but sadly simulink won't recognize it. I managed to connect the arduino to matlab, which in a weird way works when i tell matlab that my arduino is a pro mini 328 (even though it's a nano 3.0).. but i can't do that with simulink, since simulink doesn't have an option for pro mini 328 nor does it recognize it when i select nano 3.0

Anyone has any idea how i could connect my arduino to simulink?

submitted by /u/flutistyeah
[link] [comments]

"Fit" gives me an error for a simple x-y dataset.

$
0
0

I want to create a fit to a simple x-y dataset set which is given as a .mat file containing 2 arrays with the x and y coordinates.

I can plot the function with plot(fx.x,fx.y) but it gives me an error when I try to create a fit with f = fit(fx.x,fx.f,'poly2').

"Error using fit>iFit (line 135) X must be a matrix with one or two columns.

Error in fit (line 116) [fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, .."

I don't understand what is wrong, it seems perfectly in line with the example given in the help section. Can anyone help me out here? I can't seem to find whats wrong.

submitted by /u/Chaskar
[link] [comments]

Data from excel to Simulink

$
0
0

Does anyone know if it is possible to upload data from an excel spreedsheet to simulink especificaly the signal creator or if it is possible to extrat the plot from excel and use it as a signal in simulink?

submitted by /u/brofist202
[link] [comments]

Connect simulink to matlab?

$
0
0

I can connect my arduino nano 3.0 to matlab yet i can't connect it to simulink. I have tried everything and looked up everywhere and it just doesn't work. Is it possible to run a code from simulink in matlab? That way i could run the code from simulink into my arduino via matlab, since it won't work from simulink to the arduino directly

submitted by /u/flutistyeah
[link] [comments]

Improving performance on live plots

$
0
0

Hi! I'm trying to make a live plot of two vectors "u" and "pos" over time "t". I'm using "line()" to make the plots in the figure "graph". To improve performance I only plot every seventh point, since the resolution is already quite good.

In the end I wish to implement this with some sort of pause, to emulate a real-time system. However when currently testing I quickly noticed that without any explicit pause the plot still takes a really long time to make. Hence, making the live graphics seems to be very demanding for MATLAB, and I'm wondering if anyone know how to improve the performance?

EDIT: "drawnow" seems to be extremely slow as far as I can tell.

uPlot = line(graph,t(1),u(1),'Color','g','LineWidth',2);

posPlot = line(graph,t(1),pos(1),'Color','r','LineWidth',2);

for i = 1:length(t)

if mod(k,7) == 0

set(uPlot,'XData',t(1:i),'YData',u(1:i));

set(posPlot,'XData',t(1:i),'YData',pos(1:i));

end

drawnow;

k = k + 1;

end

submitted by /u/Lulle5000
[link] [comments]

Running Matlab GUI on Virtual Machine

$
0
0

Hi everyone,

Im trying to open matlab's GUI on an virtual machine using MobaXterm. However - if I type

matlab 

I get:

'MATLAB is selecting SOFTWARE OPENGL rendering.' - And nothing happens.

When I type:

matlab -nodesktop 

i get the following:

MATLAB is selecting SOFTWARE OPENGL rendering.

< M A T L A B (R) >

Copyright 1984-2020 The MathWorks, Inc.

R2020a (9.8.0.1323502) 64-bit (glnxa64)

February 25, 2020

PostVMInit failed to initialize com.mathworks.mwswing.MJStartupForDesktop

PostVMInit failed to initialize com.mathworks.mwswing.MJStartup

java.lang.NoClassDefFoundError: java.awt.Component

at javax.swing.ImageIcon$2.run(ImageIcon.java:130)

at javax.swing.ImageIcon$2.run(ImageIcon.java:128)

at java.security.AccessController.doPrivileged(Native Method)

at javax.swing.ImageIcon.createNoPermsComponent(ImageIcon.java:127)

at javax.swing.ImageIcon.access$000(ImageIcon.java:69)

at javax.swing.ImageIcon$1.run(ImageIcon.java:103)

at javax.swing.ImageIcon$1.run(ImageIcon.java:100)

at java.security.AccessController.doPrivileged(Native Method)

at javax.swing.ImageIcon.<clinit>(ImageIcon.java:100)

at com.mathworks.common.icons.IconEnumerationUtils.getIconFromCache(IconEnumerationUtils.java:368)

at com.mathworks.common.icons.IconEnumerationUtils.getIcon(IconEnumerationUtils.java:322)

at com.mathworks.common.icons.IconEnumerationUtils.getIcon(IconEnumerationUtils.java:263)

at com.mathworks.common.icons.IconEnumerationUtils.getIcon(IconEnumerationUtils.java:223)

at com.mathworks.common.icons.IconEnumerationUtils.getIcon(IconEnumerationUtils.java:219)

at com.mathworks.common.icons.MoveIcon.getIcon(MoveIcon.java:48)

at com.mathworks.widgets.desk.Desktop.<clinit>(Desktop.java:165)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.mathworks.toolstrip.plaf.TSLookAndFeel.install(TSLookAndFeel.java:29)

at com.mathworks.toolstrip.plaf.TSLookAndFeel.<clinit>(TSLookAndFeel.java:18)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at com.mathworks.util.PostVMInit$StartupClass.init(PostVMInit.java:156)

at com.mathworks.util.PostVMInit.perform(PostVMInit.java:187)

PostVMInit failed to initialize com.mathworks.toolstrip.plaf.TSLookAndFeel

To get started, type doc.

For product information, visit www.mathworks.com.

Warning: Initializing Java preferences failed in matlabrc.

This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:

MATLAB:Java:GenericException

Could not find java/awt/Component

------

Does somebody know whats going wrong & how to fix this?

submitted by /u/Snoo_19701
[link] [comments]

How to put variable in constant block in Simulink?

$
0
0

I'm new to Simulink and doing a tutorial where you multiply a constant block by a gain to get a final result. I'm attempting to put a variable 'X' in the constant block and change the block's value in the MATLAB script, but this yields an error (assuming because it's a char when the software's expecting a single/double). I'm almost positive there's a way to do this, as I'm watching a Youtube video (https://www.youtube.com/watch?v=vxzR3W2BcRk&t=2038s) and the instructor does so at 33:25.

I tried creating a new variable and set the parameter value equal to itself (=X) and kept the dimensions at [0 0] (anything else yielded an error.) Any help would be much appreciated!

I'm using MATLAB R2019b by the way

submitted by /u/iamdwang
[link] [comments]

Strange offset in system w/ PID controller

$
0
0

Hello guys,

I'm having a problem with simulink: I have a basic double integrator model with no disturbance.

When I apply a PID controller to the system, I have an offset when tracking a square wave. My question is: Shouldn't the integrative part eliminate the offset?

I used a PID controller block in simulink with this characteristics:

block diagram

subsystem

Problem:

System w/ an offset

I have no idea why this is happening. If someone could help me that would be great. Thanks!

submitted by /u/preguica00
[link] [comments]

I need to write an algorithm to compute the deteriminant of a matrix by use of row reduction? Any tips? I'm kinda lost.

$
0
0

Exactly what the title says. Any help you guys can offer would be appreciated I'm not sure how to go about it because I don't have that much MATLAB experience.

submitted by /u/DragonicStar
[link] [comments]

How do I use a custom dataset in Fuzzy ARTMAP in MATLAB?

$
0
0

I have tried using the command given in documentation but it doesn't work. There isn't any option to include my custom dataset in the GUI as well. A step-by-step tutorial will be very helpful. I'm relatively new to this software and not sure how things work. Any help would be appreciated. Thanks! :)

submitted by /u/shivaangithakur
[link] [comments]

Creating a script for sum of square residuals

$
0
0

I am trying to solve for a constant within my non-linear regression equation, and I am given a table of data in the form of a matrix. How do I go about making a Matlab equation that will behave in the way the Sr function does on paper ( Sr = SUM [ (yi - f(x)) ] ^2). I guess I just need to know how to have my Matlab equation input the required yi value and corresponding x value when running the Sr script.

submitted by /u/Bobby_Shmurda6969
[link] [comments]

I need help to calculate vehicleVar's variables from asbQuadcopterStart model in Simulink

$
0
0

This is my first matlab/simulink project and I need to change the default values of this model's drone to my drone's values but I don't understand what those variables mean, I have visited and read at least 100 websites and I still have no idea how to calculate those variables.

Please help me :((( (I'm on my last year of high school so I don't have a lot of math and physics knowledge)

(I just need help to calculate the variables with the comment %unknown)

https://preview.redd.it/9awjkcyzdk851.png?width=733&format=png&auto=webp&s=359f71ab6c625891b6b67fae168a44f39e48334f

submitted by /u/Totoratsu
[link] [comments]

Help with Simulink

$
0
0

I need to use 'to workplace' for time 't' and displacement 'x' but my 'to workplace' looks different from the one used in the lab manual and other people on YouTube.

See: https://imgur.com/a/qU1Xwjf (mine is on top)

It messes my MATLAB code and tells me the variables x and t are not recognized.

submitted by /u/HelloOkCyaBye
[link] [comments]

Can Matlab's Differential Equation solvers (ode15i) solve explicitly?

$
0
0

I have a first order nonlinear implicit DE as shown below:

0 = a*(-dz/dt)^2 + b*(-dz/dt) +c*(z(t))

When b = zero this can be re-written as an explicit DE and can be solved with ode45. Unfortunately, there are conditions for which b is not zero and the DE becomes implicit. The ode15i solver seems to work for large b values but won't work when b = 0. I receive a "failure to meet integration tolerances" error. Can ode15i solve DE's that can be written explicitly?

Thanks in advance!

submitted by /u/Scottaviusb
[link] [comments]
Viewing all 31061 articles
Browse latest View live