Quantcast
loading...

Score: 164°       Point: 39814       Stars: 0        

Java-forums
Java-forums-avatar













Java-forums

java-forums.org

vBulletin 4.0 Publishing Suite with CMS





Get Adobe Flash player


First Page < 1 2 3 4 5 6 7 8

         Blog

Rewriting MATLAB functions in Java

Hi All
I'm trying to rewrite a snippet of code I've written using Matlab into java and hoping to enlist the help of some experts.
The matlab code is;
Code:
A=[1,2,35,5,63,1.......] %some random vector dimension 1x100
B=reshape(A,10,10); %takes vector A and reshapes it (column-wise) into a 10x10 matrix
C=B*B; %Multiplys the 10x10 matrix B by itself and saves it to C
D=[1,3
11,13]; %creates a 2x2 matrix of integers
E=C(D); %returns a 2x2 matrix containing the 1st, 3rd,
...11th and 13th element of matrix C. Given this is
...a 10x10 matrix, this corresponds to the elements
...in position (1,1), (3,1), (1,2) & (3,2)
My main sticking points are;
- finding a function that can 'reshape' a vector into a matrix
- matrix multiplication for large matricies (atleast 10x10)
- e

2012-08-05 09:35:25
Similar

Problem Working through Oracle's Swing/Netbeans Tutorial.

Hello -
I tried to work through the tutorial
NetBeans IDE Basics (The Java™ Tutorials > Creating a GUI With JFC/Swing > Learning Swing with the NetBeans IDE)
on using Swing with Netbeans.
What's described looks nothing like what I see; for instance,
my Netbeans does not have an Inspector window
(Window > Navigating shows only Navigator).
Anyway, I'm not able to complete the tutorial.
I wonder if it's because I'm using jdk1.7 and
not jdk 1.6 which is used in the tutorial.
Thanks, fortunate to have this forum, Randy
PS. Learning Netbeans has been my biggest problem,
any suggestions (books, tutorials) in this regard would be appreciated.

2012-08-05 03:26:18
Similar

Can't find symbol. Constructor

Hello pros :)
I'm trying to implement a simple program which uses a constructor.
Here's my code:
Code:
import java.io.*;
class add
private int c;

void add(int a, int b)
{
c = a + b;
}

void display()
{
System.out.println("Result is " +c);
}
class Mainn
public static void main(String args[]) throws IOException
{
int x, y;
BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter 2 numbers: ");
x = Integer.parseInt(obj.readLine());
y = Integer.parseInt(obj.readLine());
add o = new add(x, y);
o.display();
}
Here' my error:add_cons.java:28: cannot find symbol
symbol : constructor add(int,int)
location: class add
add o = new add(x, y);
^
1 error
I'm using Ubuntu. Java 1.7
Thanks,

2012-08-02 17:33:33
Similar

Problems with Swing JLayer (calling repaint() doesn't update my layerUI)

Hy folks, it's my first post here, i hope i fill find a solution for my problem because it gives me headaches.
Ok i'll try to explain my problem correctly.
What i am trying to do: Make a Animated Busy Indicator like this one from the Java Turorial (see bottom of the page)
Click Here
ok, i changed the original signature of the WaitLayerUI class like this :
Code:
class WaitLayerUI extends LayerUI<ListViewCell> implements ActionListener {}
You can see also what ListViewCell is.
Code:
class ListViewCell extends JPanel implements ListCellRenderer
The problem i have starts in this method of the WaitLayerUI
Code:
@Override
public void applyPropertyChange(PropertyChangeEvent pce, JLayer l) {
if ("tick".equals(pce.getProperty Name())) {
l.repaint();
}
}
the repaint() method call

2012-07-27 19:52:50
Similar

Classes in separate files

I have one class that contains a main method, then another that does not. I want to be able create objects of the non main method class and be able to use them in any part of the main class. I'm also need to be able to get variables from the main class and use them in the class without the main method. Some people have suggested extending one class and importing one class, but when I do that the class can't find the file, should I move the class from my workspaces main file?
Thank you,
Nathan

2012-07-25 05:17:48
Similar

How to call JDialog class from JFrame class?

Hi guys, please I need some help:
At this point I only know how to call another JFrame class like this:
Code:
if(e.getSource()== openSecond){
secondClass.main(null); // open my second class
this.dispose(); // close this one
And in the second class happend the same... I call my main JFrame class and I add this.dispose() to close that frame.
Now I'm trying to have only one JFrame as main class and JDialog classes as modules of the JFrame, so, when I call JDialog I want to disable de main JFrame until the JDialog class closes.
I need someone please to help me to point me in the right direction to be able to do this.
Thanks a lot!

2012-07-23 20:52:31
Similar

very wierd! eclipse does not find java on my computer?

Hello I am very new and I have a problem that has been bothering me all day today. I have been working on a ROS (robotic OS) and I am using java for part of it. The java code itself works fine, but I just updated my java to the latest java and my whole entire eclipse can not find java... even programs like minecraft do not work. I did check my web browser and it seems to run java fine and there is a java folder within the program files folder with everything in it.
I have tried to re-install my jdk, jre and java, even installed older java. I would thank anyone who can help me :-)
p.s. I updated my java to java 7 u 5
edit: ohh and I also am now having problems with using the batch files to execute a jar file.

2012-07-22 05:57:18
Similar

restarting swi-prolog from java using jpl.jar

In one java application that uses jpl.jar to interact with swi-Prolog, I want to be able to restart the prolog engine.
An as example, in my application I use a feature such as assert(term). Now, I want to connect again swi-prolog, or restart swi-Prolog, so that my data is at first in swi-prolog. How do I use?...

2012-07-19 06:05:37
Similar

View More (Log In and Will Fans)









Win the T-shirt



with only 4000 points






















Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.

© 2010-2018 Fabrizio Fichera

dialogShowMessage!

Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.


Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !


evolveStar.com provides a search engine that allows you to gather information to write their own blog.


evolveStar.com enhances the sources displaying the logo of the site.


If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com


Specifies the subject copyright violation and the url of the page


evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.


Next will be effectual and relevant checks.