Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:44:21+00:00 2026-06-17T15:44:21+00:00

I am using JPachube.jar and Matlab in order to send data to my datastream.

  • 0

I am using JPachube.jar and Matlab in order to send data to my datastream. This java code works on my machine:

package smartclassroom;
import Pachube.Data;
import Pachube.Feed;
//import Pachube.FeedFactory;
import Pachube.Pachube;
import Pachube.PachubeException;

public class SendFeed {     

    public static void main(String arsg[]) throws InterruptedException{
        SendFeed s = new SendFeed(0.0);
        s.setZainteresovanost(0.3);
        double output = s.getZainteresovanost();      
        System.out.println("zainteresovanost " + output);             

        try {
                Pachube p = new Pachube("MYAPIKEY");
                Feed f = p.getFeed(MYFEED);
                f.updateDatastream(0, output);
            } catch (PachubeException e) {
                System.out.println(e.errorMessage);
            }
    }

    private double zainteresovanost;    
    public SendFeed(double vrednost) {
        zainteresovanost = vrednost;
    }
    public void setZainteresovanost(double vrednost) {
        zainteresovanost = vrednost;
    }
    public double getZainteresovanost() {
        return zainteresovanost;
    }

}

but I need to do this from Matlab. I have tried rewriting example (example from link is working on my machine): I have compile java class with javac and added JPachube.jar and SendFeed.class into path and then utilize this code in Matlab:

javaaddpath('C:\work')
javaMethod('main','SendFeed','');    
pachubeValue = SendFeed(0.42);

I get an error:

??? Error using ==> javaMethod
No class SendFeed can be located on Java class path

Error in ==> post_to_pachube2 at 6
javaMethod('main','SendFeed','');

This is strange because, as I said example from the link is working.

Afterwards, I decided to include JPachube directly in Matlab code and to write equivalent code in Matlab:

 javaaddpath('c:\work\JPachube.jar')

import Pachube.Data.*
import Pachube.Feed.*
import Pachube.Pachube.*
import Pachube.PachubeException.*

pachube = Pachube.Pachube('MYAPIKEY');
feed = pachube.getFeed(MYFEED);
feed.updateDatastream(0, 0.54);

And I get this error:

??? No method 'updateDatastream' with matching signature found for class 'Pachube.Feed'.

Error in ==> post_to_pachube2 at 12
feed.updateDatastream(0, 0.54);

So I have tried almost everything and nothing! Any method making this work will be fine for me. Thanks for help in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:44:21+00:00Added an answer on June 17, 2026 at 3:44 pm

    This done trick for me (answer from here)

    javaaddpath('c:\work\httpcore-4.2.2.jar');
    javaaddpath('c:\work\httpclient-4.2.3.jar');
    
    
    import org.apache.http.impl.client.DefaultHttpClient
    import org.apache.http.client.methods.HttpPost
    import org.apache.http.entity.StringEntity
    
    
    httpclient = DefaultHttpClient();
    
    httppost = HttpPost('http://api.cosm.com/v2/feeds/FEEDID/datastreams/0.csv?_method=put');
    httppost.addHeader('Content-Type','text/plain');
    httppost.addHeader('X-ApiKey','APIKEY');
    
    params = StringEntity('0.7');
    httppost.setEntity(params);
    
    response = httpclient.execute(httppost);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using this code: Java Server side: ... out = new PrintWriter(this.client.getOutputStream(), true); ... public
using this code I can send one texture to the shader: devcon->PSSetShaderResources(0, 1, &pTexture);
Using this code, the following execution yields strange results: C 100 R W The
Using this is very helpful when trying to generate html code in c#. var
Using ember 1.0.0-pre3 I have a little app that has this code: window.App =
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
Using this approach I have made my static method calls an Action in the
Using the following database table structure: Order Table: OrderId OrderName OrderItem Table: OrderId ItemId
using xmltextreader, how would I load a hashtable. XML: <base><user name=john>2342343</user><user name=mark>239099393</user></base> This was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.